use of com.dropbox.core.v2.CustomDbxRawClientV2 in project cyberduck by iterate-ch.
the class DropboxSession method connect.
@Override
protected CustomDbxRawClientV2 connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt, final CancelCallback cancel) {
final HttpClientBuilder configuration = builder.build(proxy, this, prompt);
authorizationService = new OAuth2RequestInterceptor(configuration.build(), host.getProtocol()).withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
configuration.addInterceptorLast(authorizationService);
configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService, prompt));
final CloseableHttpClient client = configuration.build();
return new CustomDbxRawClientV2(DbxRequestConfig.newBuilder(useragent.get()).withAutoRetryDisabled().withHttpRequestor(new DropboxCommonsHttpRequestExecutor(client)).build(), DbxHost.DEFAULT, null, null);
}
Aggregations