5120: Put back unwanted changes

This commit is contained in:
Ankush Bose 2022-12-18 15:37:11 +05:30
parent cc115f1e76
commit f96a5edbb9
No known key found for this signature in database
GPG key ID: 66494F34333829DA

View file

@ -19,19 +19,15 @@ import org.wikipedia.dataclient.okhttp.HttpStatusException;
import timber.log.Timber; import timber.log.Timber;
public final class OkHttpConnectionFactory { public final class OkHttpConnectionFactory {
private static final String CACHE_DIR_NAME = "okhttp-cache"; private static final String CACHE_DIR_NAME = "okhttp-cache";
private static final long NET_CACHE_SIZE = 64 * 1024 * 1024; private static final long NET_CACHE_SIZE = 64 * 1024 * 1024;
@NonNull @NonNull private static final Cache NET_CACHE = new Cache(new File(CommonsApplication.getInstance().getCacheDir(),
private static final Cache NET_CACHE = new Cache(
new File(CommonsApplication.getInstance().getCacheDir(),
CACHE_DIR_NAME), NET_CACHE_SIZE); CACHE_DIR_NAME), NET_CACHE_SIZE);
@NonNull @NonNull
private static final OkHttpClient CLIENT = createClient(); private static final OkHttpClient CLIENT = createClient();
@NonNull @NonNull public static OkHttpClient getClient() {
public static OkHttpClient getClient() {
return CLIENT; return CLIENT;
} }
@ -72,7 +68,6 @@ public final class OkHttpConnectionFactory {
} }
public static class UnsuccessfulResponseInterceptor implements Interceptor { public static class UnsuccessfulResponseInterceptor implements Interceptor {
private static final List<String> DO_NOT_INTERCEPT = Collections.singletonList( private static final List<String> DO_NOT_INTERCEPT = Collections.singletonList(
"api.php?format=json&formatversion=2&errorformat=plaintext&action=upload&ignorewarnings=1"); "api.php?format=json&formatversion=2&errorformat=plaintext&action=upload&ignorewarnings=1");