public class StaticTokenRequestInterceptor
extends java.lang.Object
implements org.apache.http.HttpRequestInterceptor
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AUTH_HEADER |
| Constructor and Description |
|---|
StaticTokenRequestInterceptor()
Default constructor
|
StaticTokenRequestInterceptor(java.lang.String token) |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.http.client.HttpClient |
defaultClient(StaticTokenRequestInterceptor interceptor)
Convenience factory method.
|
void |
process(org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context) |
void |
setToken(java.lang.String token) |
public static final java.lang.String AUTH_HEADER
public StaticTokenRequestInterceptor()
public StaticTokenRequestInterceptor(java.lang.String token)
token - the authentication token to usepublic void setToken(java.lang.String token)
token - the authentication token to usepublic void process(org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context)
process in interface org.apache.http.HttpRequestInterceptorpublic static org.apache.http.client.HttpClient defaultClient(StaticTokenRequestInterceptor interceptor)
interceptor - the interceptor to use, presumably an instance of StaticTokenRequestInterceptorHttpClient that is wrapped with this interceptor