Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Daniel d.19
9 years agoNew member | Level 1
Listing Shared & Deleted Files v2.1.1 Java API
Hi All,
Newer to Dropbox development so my apologies for any noobishness. I haven't seen another solution on stackoverflow or this forum.
I'm attempting to list out all files and folders that have been soft-deleted, including shared items. My solution successfully lists out non-shared items and I can list out shared items but not items that are both deleted and shared. Is this something I'm doing or an issue with the API?
Here's a source excerpt...
DbxUserSharingRequests sharing = client.sharing();
ListFoldersResult listSharedFolderResults = sharing.listFolders();
List<SharedFolderMetadata> sharedFolders = listSharedFolderResults.getEntries();
for(SharedFolderMetadata sharedFolder : sharedFolders) {
System.out.println("Found shared folder: " + sharedFolder.toStringMultiline());
}
ListSharedLinksResult listSharedFileResults = sharing.listSharedLinksBuilder().withDirectOnly(false).start();
List<SharedLinkMetadata> sharedFiles = listSharedFileResults.getLinks();
for(SharedLinkMetadata sharedFile : sharedFiles) {
System.out.println("Found shared file: " + sharedFile.toStringMultiline());
}
Any thoughts on this very welcome!
Thanks,
Dan
1 Reply
- Greg-DB9 years ago
Dropbox Community Moderator
Hi Dan, by "soft-deleted", do you mean files that have been deleted but not permanently deleted?
If so, it sounds like you're looking for ListFolderBuilder using withIncludeDeleted(true), and listFolderContinue (in the files namespace).
Using those, you can list out (in a paginated fashion) all of the files and folders in the account, whether or not they're deleted. You can get the basic sharing information for each Metadata in the sharingInfo field. You can then call the relevant sharing methods if you need more information about them.
Hope this helps! Let me know if I've misunderstood though.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!