Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- private static final String ACCESS_TOKEN = "MY ACCESSTOCKEN";
- public static void main(String args[]) throws DbxException, IOException {
- DbxRequestConfig config = new DbxRequestConfig("dropbox/java-tutorial", "en_US");
- DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);
- FullAccount account = client.users().getCurrentAccount();
- ListFolderResult result = client.files().listFolder("");
- while (true) {
- for (Metadata metadata : result.getEntries()) { }
- if (!result.getHasMore()) {
- break;
- }
- result = client.files().listFolderContinue(result.getCursor());
- }
- try (InputStream in = new FileInputStream("test.txt")) {
- FileMetadata metadata = client.files().uploadBuilder("/test.txt")
- .uploadAndFinish(in);
- }
- }
- }
Add Comment
Please, Sign In to add comment