blob: 872032867aefd7c59fa2b626d742aec3176e13c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package com.mapbox.mapboxsdk.http;
import okhttp3.OkHttpClient;
/**
* Utility class for setting HttpRequest configurations
*/
public class HttpRequestUtil {
/**
* Set the log state of HttpRequest. Default value is true.
* <p>
* This configuration will outlast the lifecycle of the Map.
* </p>
*
* @param enabled True will enable logging, false will disable
*/
public static void setLogEnabled(boolean enabled) {
HTTPRequest.enableLog(enabled);
}
/**
* Enable printing of the request url when an error occurred. Default value is false.
* <p>
* Requires {@link #setLogEnabled(boolean)} to be activated.
* </p>
* <p>
* This configuration will outlast the lifecycle of the Map.
* </p>
*
* @param enabled True will print urls, false will disable
*/
public static void setPrintRequestUrlOnFailure(boolean enabled) {
HTTPRequest.enablePrintRequestUrlOnFailure(enabled);
}
/**
* Set the OkHttpClient used for requesting map resources.
*
* @param client the OkHttpClient
*/
public static void setOkHttpClient(OkHttpClient client) {
HTTPRequest.setOKHttpClient(client);
}
}
|