I creating app for uploading files into Dropbox. Right now I stuck working with files / folders inside Dropbox. By this tutorial I create this method for getting data about folders and create new folder inside Dropbox https://github.com/dropbox/dropbox-sdk-java, but it does not works. I can get data about my account, but when I try to get data about folders it stucks. I also already try to allow all file permissions in dropbox app settings.
private void createFolder() throws DbxException {
log.info("start createFolder");
FullAccount userData = clientV2.users().getCurrentAccount();
log.info("userData {}", userData.getName());
// Get files and folder metadata from Dropbox root directory
ListFolderResult result = clientV2.files().listFolder("");
while (true) {
for (Metadata metadata : result.getEntries()) {
log.info(metadata.getPathLower());
}
if (!result.getHasMore()) {
break;
}
result = clientV2.files().listFolderContinue(result.getCursor());
}
}Response:
2024-05-02T17:05:32.800+02:00 INFO 33560 --- [mail] [Mail-EventQueue] com.example.mail.component.Monitor : start createFolder
2024-05-02T17:05:33.915+02:00 INFO 33560 --- [mail] [Mail-EventQueue] com.example.mail.component.Monitor : userData {"given_name":"Miloslav","surname":"Lejček","familiar_name":"Miloslav","display_name":"Miloslav Lejček","abbreviated_name":"ML"}