Showing results for 
Search instead for 
Did you mean: 
Update: Find information on Dropbox support during COVID-19 here
Showing results for 
Search instead for 
Did you mean: 

Listing Shared & Deleted Files v2.1.1 Java API

Daniel d.19 New member | Level 1
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

Re: Listing Shared & Deleted Files v2.1.1 Java API


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.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?