Build 1.0_r1(from source)

android.net.http
Class HttpAuthHeader

java.lang.Object
  extended by android.net.http.HttpAuthHeader

public class HttpAuthHeader
extends Object

HttpAuthHeader: a class to store HTTP authentication-header parameters. For more information, see: RFC 2617: HTTP Authentication.


Field Summary
static int BASIC
           
static String BASIC_TOKEN
          Possible HTTP-authentication header tokens to search for:
static int DIGEST
           
static String DIGEST_TOKEN
           
static int UNKNOWN
           
 
Constructor Summary
HttpAuthHeader(String header)
          Creates a new HTTP-authentication header object from the input header string.
 
Method Summary
 String getAlgorithm()
           
 String getNonce()
           
 String getOpaque()
           
 String getPassword()
           
 String getQop()
           
 String getRealm()
           
 int getScheme()
           
 boolean getStale()
           
 String getUsername()
           
 boolean isBasic()
           
 boolean isDigest()
           
 boolean isProxy()
           
 boolean isSupportedScheme()
           
 void setPassword(String password)
          Sets the password string.
 void setProxy()
          Marks this header as a proxy authentication header.
 void setUsername(String username)
          Sets the username string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASIC_TOKEN

public static final String BASIC_TOKEN
Possible HTTP-authentication header tokens to search for:

See Also:
Constant Field Values

DIGEST_TOKEN

public static final String DIGEST_TOKEN
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

BASIC

public static final int BASIC
See Also:
Constant Field Values

DIGEST

public static final int DIGEST
See Also:
Constant Field Values
Constructor Detail

HttpAuthHeader

public HttpAuthHeader(String header)
Creates a new HTTP-authentication header object from the input header string. The header string is assumed to contain parameters of at most one authentication-scheme (ensured by the caller).

Method Detail

isProxy

public boolean isProxy()
Returns:
True iff this is a proxy authentication header.

setProxy

public void setProxy()
Marks this header as a proxy authentication header.


getUsername

public String getUsername()
Returns:
The username string.

setUsername

public void setUsername(String username)
Sets the username string.


getPassword

public String getPassword()
Returns:
The password string.

setPassword

public void setPassword(String password)
Sets the password string.


isBasic

public boolean isBasic()
Returns:
True iff this is the BASIC-authentication request.

isDigest

public boolean isDigest()
Returns:
True iff this is the DIGEST-authentication request.

getScheme

public int getScheme()
Returns:
The authentication scheme requested. We currently support two schemes: HttpAuthHeader.BASIC - basic, and HttpAuthHeader.DIGEST - digest (algorithm=MD5, QOP="auth").

getStale

public boolean getStale()
Returns:
True if indicating that the previous request from the client was rejected because the nonce value was stale.

getRealm

public String getRealm()
Returns:
The realm value or null if there is none.

getNonce

public String getNonce()
Returns:
The nonce value or null if there is none.

getOpaque

public String getOpaque()
Returns:
The opaque value or null if there is none.

getQop

public String getQop()
Returns:
The QOP ("quality-of_protection") value or null if there is none. The QOP value is always lower-case.

getAlgorithm

public String getAlgorithm()
Returns:
The name of the algorithm used or null if there is none. By default, MD5 is used.

isSupportedScheme

public boolean isSupportedScheme()
Returns:
True iff the authentication scheme requested by the server is supported; currently supported schemes: BASIC, DIGEST (only algorithm="md5", no qop or qop="auth).

Build 1.0_r1(from source)

Please submit a feedback, bug or feature