// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/config/Config.java
// public class Config {
//     public static final String HOST = "https://api.500px.com/";
// 
//     public static final HttpLoggingInterceptor.Level HTTP_LOG_LEVEL =
//             HttpLoggingInterceptor.Level.HEADERS;
// 
// 
//     public static final String REQUEST_TOKEN_URL = HOST + "v1/oauth/request_token";
//     public static final String ACCESS_TOKEN_URL = HOST + "v1/oauth/access_token";
//     public static final String AUTH_CALLBACK_URL = "";
// 
//     public static final String CONSUMER_KEY = "<INSERT YOUR 500PX CONSUMER KEY>";
//     public static final String CONSUMER_SECRET = "<INSERT YOUR 500PX CONSUMER SECRET>";
// 
//     public static final String X_AUTH_MODE = "client_auth";
//     public static final String X_AUTH_USERNAME = "<INSERT YOUR 500PX USERNAME>";
//     public static final String X_AUTH_PASSWORD = "<INSERT YOUR 500PX PASSWORD>";
// 
//     public static final String USERNAME = X_AUTH_USERNAME;
// }
// 
// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/service/XOAuthProvider.java
// public class XOAuthProvider extends AbstractOAuthProvider {
// 
//     private transient OkHttpClient okHttpClient;
// 
//     public XOAuthProvider(String requestTokenEndpointUrl, String accessTokenEndpointUrl,
//                                String authorizationWebsiteUrl) {
//         super(requestTokenEndpointUrl, accessTokenEndpointUrl, authorizationWebsiteUrl);
//         this.okHttpClient = new OkHttpClient();
//     }
// 
//     public XOAuthProvider(String requestTokenEndpointUrl, String accessTokenEndpointUrl,
//                                String authorizationWebsiteUrl, OkHttpClient okHttpClient) {
//         super(requestTokenEndpointUrl, accessTokenEndpointUrl, authorizationWebsiteUrl);
//         this.okHttpClient = okHttpClient;
//     }
// 
//     public void setOkHttpClient(OkHttpClient okHttpClient) {
//         this.okHttpClient = okHttpClient;
//     }
// 
//     @Override
//     protected HttpRequest createRequest(String endpointUrl) throws Exception {
//         final Request.Builder builder =
//                 new Request.Builder()
//                         .url(endpointUrl)
//                         .post(Util.EMPTY_REQUEST);
//         if (endpointUrl.contains(Config.ACCESS_TOKEN_URL)) {
//             final MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
//             final String body =
//                     String.format("x_auth_mode=%s&x_auth_password=%s&x_auth_username=%s",
//                             Config.X_AUTH_MODE, Config.X_AUTH_PASSWORD, Config.X_AUTH_USERNAME);
//             builder.post(RequestBody.create(mediaType, body));
//         }
//         return new OkHttpRequestAdapter(builder.build());
//     }
// 
//     @Override
//     protected HttpResponse sendRequest(HttpRequest request) throws Exception {
//         Response response = okHttpClient.newCall((Request) request.unwrap()).execute();
//         return new OkHttpResponseAdapter(response);
//     }
// }


import android.app.Application;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.jagsaund.rxuploader.sample.config.Config;
import com.jagsaund.rxuploader.sample.service.XOAuthProvider;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import rx.Completable;
import rx.Observable;
import se.akerfeldt.okhttp.signpost.OkHttpOAuthConsumer;
import timber.log.Timber;
package com.jagsaund.rxuploader.sample;


public class SampleApplication extends Application {
    private static String token;
    private static String secret;

    @NonNull
    public static Completable authorize() {
        final OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
        final HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/config/Config.java
// public class Config {
//     public static final String HOST = "https://api.500px.com/";
// 
//     public static final HttpLoggingInterceptor.Level HTTP_LOG_LEVEL =
//             HttpLoggingInterceptor.Level.HEADERS;
// 
// 
//     public static final String REQUEST_TOKEN_URL = HOST + "v1/oauth/request_token";
//     public static final String ACCESS_TOKEN_URL = HOST + "v1/oauth/access_token";
//     public static final String AUTH_CALLBACK_URL = "";
// 
//     public static final String CONSUMER_KEY = "<INSERT YOUR 500PX CONSUMER KEY>";
//     public static final String CONSUMER_SECRET = "<INSERT YOUR 500PX CONSUMER SECRET>";
// 
//     public static final String X_AUTH_MODE = "client_auth";
//     public static final String X_AUTH_USERNAME = "<INSERT YOUR 500PX USERNAME>";
//     public static final String X_AUTH_PASSWORD = "<INSERT YOUR 500PX PASSWORD>";
// 
//     public static final String USERNAME = X_AUTH_USERNAME;
// }
// 
// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/service/XOAuthProvider.java
// public class XOAuthProvider extends AbstractOAuthProvider {
// 
//     private transient OkHttpClient okHttpClient;
// 
//     public XOAuthProvider(String requestTokenEndpointUrl, String accessTokenEndpointUrl,
//                                String authorizationWebsiteUrl) {
//         super(requestTokenEndpointUrl, accessTokenEndpointUrl, authorizationWebsiteUrl);
//         this.okHttpClient = new OkHttpClient();
//     }
// 
//     public XOAuthProvider(String requestTokenEndpointUrl, String accessTokenEndpointUrl,
//                                String authorizationWebsiteUrl, OkHttpClient okHttpClient) {
//         super(requestTokenEndpointUrl, accessTokenEndpointUrl, authorizationWebsiteUrl);
//         this.okHttpClient = okHttpClient;
//     }
// 
//     public void setOkHttpClient(OkHttpClient okHttpClient) {
//         this.okHttpClient = okHttpClient;
//     }
// 
//     @Override
//     protected HttpRequest createRequest(String endpointUrl) throws Exception {
//         final Request.Builder builder =
//                 new Request.Builder()
//                         .url(endpointUrl)
//                         .post(Util.EMPTY_REQUEST);
//         if (endpointUrl.contains(Config.ACCESS_TOKEN_URL)) {
//             final MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
//             final String body =
//                     String.format("x_auth_mode=%s&x_auth_password=%s&x_auth_username=%s",
//                             Config.X_AUTH_MODE, Config.X_AUTH_PASSWORD, Config.X_AUTH_USERNAME);
//             builder.post(RequestBody.create(mediaType, body));
//         }
//         return new OkHttpRequestAdapter(builder.build());
//     }
// 
//     @Override
//     protected HttpResponse sendRequest(HttpRequest request) throws Exception {
//         Response response = okHttpClient.newCall((Request) request.unwrap()).execute();
//         return new OkHttpResponseAdapter(response);
//     }
// }


// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/SampleApplication.java
import android.app.Application;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.jagsaund.rxuploader.sample.config.Config;
import com.jagsaund.rxuploader.sample.service.XOAuthProvider;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import rx.Completable;
import rx.Observable;
import se.akerfeldt.okhttp.signpost.OkHttpOAuthConsumer;
import timber.log.Timber;

package com.jagsaund.rxuploader.sample;


public class SampleApplication extends Application {
    private static String token;
    private static String secret;

    @NonNull
    public static Completable authorize() {
        final OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
        final HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
        loggingInterceptor.setLevel(Config.HTTP_LOG_LEVEL);