-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Dropbox4j - Dropbox API Java implementation licensed with Apache License v.2
Dropbox4j makes it easier to download, upload, move, copy, delete and etc files in Dropbox. It supports for web authentication (with authorization url) and mobile authentication (with user's credentials). All returned by Dropbox4j data are POJOs or helpers, so you have no problems with working with them using GWT and etc.
Current stable version: 0.2
Current snapshot version: 0.3-SNAPSHOT
To get ready to use DropboxClient
you should do one of operations:
- Using web auth (by url)
WebAuthentication auth = DropboxClientBuilder.build(APP_KEY, APP_SECRET).web("https://www.frostman.ru/dp");
System.out.println("Auth url:\n" + auth.getAuthorizationUrl() + "\nPress any key after accepting app");
new Scanner(System.in).nextLine();
DropboxClient client = auth.receiveAccessToken();
- Using user's credentials
DropboxClient client = DropboxClientBuilder.build(APP_KEY, APP_SECRET).mobile().authenticate(email, password);
- Using existing access token
DropboxClient client = DropboxClientBuilder.build(APP_KEY, APP_SECRET, ACCESS_TOKEN, ACCESS_SECRET);
Now when you have instance of DropboxClient
you can make operations ith your Dropbox account.
You can find description of each of the supported operations in javadocs for methods of class DropboxClient
.
There is some of the operations:
- copy(File from, File to)
- putFile(File file, String path)
- getFile(String path)
etc
All of the descripted at official Dropbox API page methods are supported. Some additional methods will be added soon.
All non 200 http codes will be returned as throwing DropboxHttpCodeException
that will contains http code and long message if exists.
- Add artifact to maven central repo.
- Implement additional API methods (if find info about them).
Releases repo: Maven central sync from https://oss.sonatype.org/content/repositories/releases/
<dependency>
<groupId>ru.frostman.dropbox</groupId>
<artifactId>dropbox4j</artifactId>
<version>VERSION</version>
</dependency>
Snapshots repo: https://oss.sonatype.org/content/repositories/snapshots/
<repository>
<id>OSS Sonatype Snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>