public class ClientInterceptor
extends java.lang.Object
implements okhttp3.Interceptor
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTHORIZATION
The authorization key.
|
static java.lang.String |
USER_AGENT
The user-agent key.
|
static java.lang.String |
USER_AGENT_VAL
The user-agent value key.
|
Constructor and Description |
---|
ClientInterceptor() |
Modifier and Type | Method and Description |
---|---|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain)
Adds headers to request for user-agent and authorization info.
|
boolean |
isAuthenticated()
Determines if the client is authenticated.
|
void |
setToken(java.lang.String token) |
public static final java.lang.String AUTHORIZATION
public static final java.lang.String USER_AGENT
public static final java.lang.String USER_AGENT_VAL
@NotNull public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws java.io.IOException
intercept
in interface okhttp3.Interceptor
chain
- the chainjava.io.IOException
- if the chain fails to proceedpublic boolean isAuthenticated()
public void setToken(java.lang.String token)
token
- the new access token