Skip to content

umjammer/vavi-nio-file-dropbox

 
 

Repository files navigation

Release Actions Status CodeQL Java Parent

vavi-nio-file-dropbox

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

original

Install

jars

selenium chrome driver (obsoleted, use 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 of all, you MUST have a Dropbox account. Then you need to register an application. This application must have full access, and handle any types of files.

Next, prepare 2 property files.

  • application credential
$ cat ${HOME}/.vavifuse/dropbox.properties
dropbox.applicationName=your_application_name
dropbox.clientId=your_client_id
dropbox.clientSecret=your_client_secret
dropbox.redirectUrl=http://localhost:30000
dropbox.scopes=files.content.write
  • user credential
$ cat ${HOME}/.vavifuse/credentials.properties
dropbox.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("dropbox:///?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/dropbox/Main.java

TODO

  • project name to vavi-nio-file-dropbox
  • rename main branch