Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
novotny
4 years agoExplorer | Level 4
backend Java process to read a shared folder
Hi,
We need a java workflow to scan the contents of a shared folder on a daily basis. I have downloaded the examples and looked at AuthorizeExample which I ran with the parameters "test.app tes...
novotny
4 years agoExplorer | Level 4
Ok thanks, so the code I have should work fine? However what happens when the app restarts and the original hardcoded credentials have expired already? (Since the EXPIRES_AT has been hardcoded) Will that still work?
Здравко
4 years agoLegendary | Level 20
It's related to access token only! Refresh token doesn't expire. 😉
- novotny4 years agoExplorer | Level 4
Let me make this clearer with code:
public DbxClientV2 createClient() throws DbxException {
DbxRequestConfig config = DbxRequestConfig.newBuilder("fingage").build();
DbxCredential dbxCredential = new DbxCredential(ACCESS_TOKEN, EXPIRES_AT, REFRESH_TOKEN, APP_KEY, APP_SECRET);
DbxTeamClientV2 teamClientV2 = new DbxTeamClientV2(config, dbxCredential);
PathRoot pathRoot = PathRoot.namespaceId("3103421521");
return teamClientV2.asMember("dbmid:AACV-hRckJZMB5ja-BpNuhN0PRjZod6__94").withPathRoot(pathRoot);
}It appears this code will work in creating DbxCredential since the EXPIRES_AT is in the future. However if I run this code in a few days, will it still work? Is it the case that if the supplied expiresAt is in the past will it still be able to refresh the credential? Or can I just provide a value for expiresAt that is far into the future?
Thanks again
- Greg-DB4 years ago
Dropbox Community Moderator
novotny Yes, the expiration is only about the access token. The refresh token doesn't expire (though can be revoked on demand). If the expiration has passed, the client will use the refresh token to get a new access token automatically.
- Здравко4 years agoLegendary | Level 20
Something more: don't try change 'expireAt'. Your code will fail!!! There are ways to optimize your code but you need to keep entire credentials object and serialize and deserialize it. Don't change anything by hands there.
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!