Showing results for 
Show  only  | Search instead for 
Did you mean: 
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

Showing results for 
Show  only  | Search instead for 
Did you mean: 

Listing Shared & Deleted Files v2.1.1 Java API

Listing Shared & Deleted Files v2.1.1 Java API

Daniel d.19
New member | Level 1

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!



1 Reply 1

Dropbox Staff

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?