|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.http.BasicAuthentication
public final class BasicAuthentication
Basic authentication HTTP request initializer as specified in Basic Authentication Scheme
Implementation is immutable and thread-safe. It can be used as either an HTTP request initializer
or an HTTP request execute interceptor. initialize(HttpRequest)
only sets itself as the
interceptor. Authentication is actually done in intercept(HttpRequest)
, which is
implemented using HttpHeaders.setBasicAuthentication(String, String)
.
Warning: for backwards-compatibility initialize(com.google.api.client.http.HttpRequest)
also calls
intercept(HttpRequest)
, but this call will be removed in version 1.8.
Constructor Summary | |
---|---|
BasicAuthentication(String username,
String password)
|
Method Summary | |
---|---|
String |
getPassword()
Returns the password. |
String |
getUsername()
Returns the username. |
void |
initialize(HttpRequest request)
Initializes a request. |
void |
intercept(HttpRequest request)
Invoked at the start of HttpRequest.execute() before executing the HTTP request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicAuthentication(String username, String password)
Method Detail |
---|
public void initialize(HttpRequest request) throws IOException
HttpRequestInitializer
initialize
in interface HttpRequestInitializer
request
- HTTP request
IOException
public void intercept(HttpRequest request) throws IOException
HttpExecuteInterceptor
HttpRequest.execute()
before executing the HTTP request.
intercept
in interface HttpExecuteInterceptor
IOException
public String getUsername()
public String getPassword()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |