You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class RestDataSource {
private static final int CONNECT_TIMEOUT_MILLIS = 30;
private static final int READ_TIMEOUT_MILLIS = 30;
private final CacheProviders cacheProviders;
private RestApiService restApi;
@Inject
public RestDataSource(File cacheDir, MsAuthorizer msAuthorizer) {
cacheProviders = new RxCache.Builder()
.persistence(cacheDir)
.using(CacheProviders.class);
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient okHttpClient = new OkHttpClient().newBuilder().
connectTimeout(CONNECT_TIMEOUT_MILLIS, TimeUnit.SECONDS).
readTimeout(READ_TIMEOUT_MILLIS, TimeUnit.SECONDS).addInterceptor(new MsInterceptor(msAuthorizer.getAccessToken())).
addInterceptor(httpLoggingInterceptor).build();
Retrofit retrofit = new Retrofit.Builder().baseUrl(Constants.BASE_URL).
client(okHttpClient).
addCallAdapterFactory(RxJavaCallAdapterFactory.create()).
addConverterFactory(GsonConverterFactory.create()).build();
restApi =retrofit.create(RestApiService.class);
}
public Observable<Reply<List<CategoryEntity>>> getCategory(final boolean update) {
return cacheProviders.getCategory(restApi.getCategory(), new EvictProvider(update));
}
}
The text was updated successfully, but these errors were encountered:
sungerk
changed the title
i copy some code of yout project ,but has catch: contains a dependency cycle
i copy some code of your project ,but has catch: contains a dependency cycle
May 15, 2016
The text was updated successfully, but these errors were encountered: