We’re aware of an issue causing slower load times on the Dropbox Community forum. It should be resolved soon. Thanks for your patience! 

Forum Discussion

bauerb's avatar
bauerb
Explorer | Level 3
5 years ago

How to navigate to Team root with JDK

I have been trying all day to access my team's root folder with the Java SDK and I haven't been able to find any documentation.

 

My folder structure is like this:

 

 

/MyName
/Folder-I-Want-To-Access
/Other-Folder-I-Want-To-Access

 

 

 

Unfortunately I'm trying to do this in Rhino, so apologies that this doesn't look like normal Java 🤦‍♂️ I don't really know where to go from here:

 

 

 

var config = new com.dropbox.core.DbxRequestConfig("dropbox/java-tutorial", "en_US");
var teamClient = new com.dropbox.core.v2.DbxTeamClientV2(config, accessToken);
var client = teamClient.asMember('my-id');

 

 

 

 the TeamClient doesn't have the file access methods, but the individual Client always has it's root set to /MyName. How can I navigate paths with the JDK?

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    It sounds like you want access the folders in your "team space". By default, Dropbox API calls operate in the "member folder", not the team space, but you can configure them to operate in the team space when desired, by setting the "Dropbox-API-Path-Root" header. For information on how to do so, please refer to the Team Files Guide.

     

    With the Java SDK in particular, you can set the "Dropbox-API-Path-Root" header using the DbxClientV2.withPathRoot method.