Search in sources :

Example 1 with Ok3Client

use of com.jakewharton.retrofit.Ok3Client in project philm by chrisbanes.

the class PhilmTmdb method newRestAdapterBuilder.

@Override
protected RestAdapter.Builder newRestAdapterBuilder() {
    RestAdapter.Builder b = super.newRestAdapterBuilder();
    if (mCacheLocation != null) {
        File cacheDir = new File(mCacheLocation, "tmdb_requests");
        Cache cache = new Cache(cacheDir, CACHE_SIZE);
        OkHttpClient client = new OkHttpClient.Builder().cache(cache).build();
        b.setClient(new Ok3Client(client));
    }
    return b;
}
Also used : OkHttpClient(okhttp3.OkHttpClient) Ok3Client(com.jakewharton.retrofit.Ok3Client) RestAdapter(retrofit.RestAdapter) File(java.io.File) Cache(okhttp3.Cache)

Example 2 with Ok3Client

use of com.jakewharton.retrofit.Ok3Client in project philm by chrisbanes.

the class PhilmTrakt method newRestAdapterBuilder.

@Override
protected RestAdapter.Builder newRestAdapterBuilder() {
    RestAdapter.Builder b = super.newRestAdapterBuilder();
    if (mCacheLocation != null) {
        File cacheDir = new File(mCacheLocation, "trakt_requests");
        Cache cache = new Cache(cacheDir, CACHE_SIZE);
        OkHttpClient client = new OkHttpClient.Builder().cache(cache).build();
        b.setClient(new Ok3Client(client));
    }
    return b;
}
Also used : OkHttpClient(okhttp3.OkHttpClient) Ok3Client(com.jakewharton.retrofit.Ok3Client) RestAdapter(retrofit.RestAdapter) File(java.io.File) Cache(okhttp3.Cache)

Aggregations

Ok3Client (com.jakewharton.retrofit.Ok3Client)2 File (java.io.File)2 Cache (okhttp3.Cache)2 OkHttpClient (okhttp3.OkHttpClient)2 RestAdapter (retrofit.RestAdapter)2