I had to use java dropbox api for my app, but my school require proxy to use the internet. so how i can add proxy to my app? if i can, can you please give me the example. thank for the support!
Yes, if you're using the official API v2 Java SDK, you can set a proxy by constructing a StandardHttpRequestor with a StandardHttpRequestor.Config. You can build a StandardHttpRequestor.Config with a proxy set by using StandardHttpRequestor.Config.builder to get a StandardHttpRequestor.Config.Builder and using the withProxy method.
That would look something like:
StandardHttpRequestor.Config.Builder requestorConfigBuilder = StandardHttpRequestor.Config.builder();requestorConfigBuilder.withProxy(yourProxy);StandardHttpRequestor.Config requestorConfig = requestorConfigBuilder.build();StandardHttpRequestor requestor = new StandardHttpRequestor(requestorConfig);DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder("testApp/") .withHttpRequestor(requestor) .build();DbxClientV2 client = new DbxClientV2(requestConfig, ACCESS_TOKEN);