Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
abhinav-gogoi-clairvoyant
3 years agoNew member | Level 2
listSharedLinks() by non-empty path in JAVA SDK
I am trying to list shared links using the below code and it works.
But I don't need ALL of the sharedLinks. This list is huge.
How can I specify a path like this listSharedLinks(String path) ? I want to list shared links only for this path.
List<SharedLinkMetadata> sharedLinkMetadataList =
client
.asMember(memberId)
.withPathRoot(PathRoot.namespaceId(rootNS))
.sharing()
.listSharedLinks()
.getLinks();
The Java SDK docs says - But I see no overloaded methods where I can provide a non-empty path.
If no path is given, returns a list of all shared links for the current user.
If a non-empty path is given, returns a list of all shared links that allow access to the given path - direct links to the given path and links to parent folders of the given path. Links to parent folders can be suppressed by setting direct_only to true.
Please Help 🙏 Thanks a lot.
2 Replies
- Здравко3 years agoLegendary | Level 20
- Greg-DB3 years ago
Dropbox Community Moderator
abhinav-gogoi-clairvoyant Yes, as Здравко helpfully linked to, you can use ListSharedLinksBuilder to specify a path. In particular, you would use ListSharedLinksBuilder.withPath. (The Java SDK uses this "builder" pattern to support passing parameters on many calls like this.)
Working from your sample code, that would look like this:
List<SharedLinkMetadata> sharedLinkMetadataList = client .asMember(memberId) .withPathRoot(PathRoot.namespaceId(rootNS)) .sharing() .listSharedLinksBuilder() .withPath(path) .start() .getLinks();
About Discuss Dropbox Developer & API
Make connections with other developers
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!