Skip to content

umjammer/vavi-nio-file-box

 
 

Repository files navigation

Release Java CI CodeQL Java Parent

vavi-nio-file-box

Java filesystem SPI (JSR-203) over DropBox API.

original

Install

jars

selenium chrome driver (obsolete, use os default browser)

  • Download the chromedriver executable and locate it into some directory.
    • Don't forget to run jvm with jvm argument -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver.

Usage

First, get box account, then create box app.

Next, prepare 2 property files.

  • application credential
$ cat ${HOME}/.vavifuse/box.properties
box.applicationName=your_application_name
box.clientId=your_client_id
box.clientSecret=your_client_secret
box.redirectUrl=http://localhost:30001
box.scopes=root_readwrite
  • user credential
$ cat ${HOME}/.vavifuse/credentials.properties
box.password.xxx@yyy.zzz=your_password

Then write your code! Here is a short example (imports omitted for brevity):

public class Main {

    public static void main(String[] args) throws IOException {
        String email = "xxx@yyy.zzz";

        URI uri = URI.create("box:///?id=" + email);

        FileSystem fs = FileSystems.newFileSystem(uri, env);
            :
    }
}

See also

https://github.com/umjammer/vavi-apps-fuse/blob/master/vavi-nio-file-gathered/src/test/java/vavi/nio/file/box/Main.java

TODO

  • dev token authenticator
  • project name to vavi-nio-file-box
  • rename main branch

⚠ Note to self