Search in sources :

Example 1 with StandardHttpRequestor

use of com.dropbox.core.http.StandardHttpRequestor in project dropbox-sdk-java by dropbox.

the class Main method createClient.

/**
     * Create a new Dropbox client using the given authentication
     * information and HTTP client config.
     *
     * @param auth Authentication information
     * @param config HTTP request configuration
     *
     * @return new Dropbox V2 client
     */
private static DbxClientV2 createClient(DbxAuthInfo auth, StandardHttpRequestor.Config config) {
    String clientUserAgentId = "examples-longpoll";
    StandardHttpRequestor requestor = new StandardHttpRequestor(config);
    DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder(clientUserAgentId).withHttpRequestor(requestor).build();
    return new DbxClientV2(requestConfig, auth.getAccessToken(), auth.getHost());
}
Also used : StandardHttpRequestor(com.dropbox.core.http.StandardHttpRequestor) DbxClientV2(com.dropbox.core.v2.DbxClientV2) DbxRequestConfig(com.dropbox.core.DbxRequestConfig)

Aggregations

DbxRequestConfig (com.dropbox.core.DbxRequestConfig)1 StandardHttpRequestor (com.dropbox.core.http.StandardHttpRequestor)1 DbxClientV2 (com.dropbox.core.v2.DbxClientV2)1