org.w3c.www.http
Class HttpCredential

java.lang.Object
  extended by org.w3c.www.http.BasicValue
      extended by org.w3c.www.http.HttpCredential
All Implemented Interfaces:
java.lang.Cloneable, HeaderValue

public class HttpCredential
extends BasicValue

This class has a hack to handle basic authentication. Basic authentication (amongst others) is broken in the HTTP spec, to handle the APIs more nicely, Jigsaw fakes a cookie auth param with the appropriate basic-credentials.


Field Summary
 
Fields inherited from class org.w3c.www.http.BasicValue
isValid, raw, rlen, roff
 
Constructor Summary
HttpCredential()
           
HttpCredential(boolean isValid, java.lang.String scheme)
           
 
Method Summary
 java.lang.String getAuthParameter(java.lang.String name)
          Get an authentication parameter.
 java.lang.String getScheme()
          Get the authentication scheme identifier.
 java.lang.Object getValue()
          HeaderValue implemenntation - Get this header value.
protected  void parse()
          parse.
 void setAuthParameter(java.lang.String name, java.lang.String value)
          Set an auth parameter value.
 void setAuthParameter(java.lang.String name, java.lang.String value, boolean quoted)
          Set an auth parameter value.
 void setScheme(java.lang.String scheme)
          Set the authentication scheme.
protected  void updateByteValue()
          Update the RFC822 compatible header value for this object.
 
Methods inherited from class org.w3c.www.http.BasicValue
addBytes, appendValue, checkByteValue, clone, emit, error, invalidateByteValue, setBytes, setString, toExternalForm, toString, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpCredential

public HttpCredential(boolean isValid,
                      java.lang.String scheme)

HttpCredential

public HttpCredential()
Method Detail

parse

protected void parse()
              throws HttpParserException
parse.

Specified by:
parse in class BasicValue
Throws:
HttpParserException - if parsing failed.

updateByteValue

protected void updateByteValue()
Description copied from class: BasicValue
Update the RFC822 compatible header value for this object.

Specified by:
updateByteValue in class BasicValue

getValue

public java.lang.Object getValue()
Description copied from class: BasicValue
HeaderValue implemenntation - Get this header value.

Specified by:
getValue in interface HeaderValue
Specified by:
getValue in class BasicValue
Returns:
An object representing the parsed value for this header.

getScheme

public java.lang.String getScheme()
Get the authentication scheme identifier.

Returns:
A String giving the auth scheme identifier.

setScheme

public void setScheme(java.lang.String scheme)
Set the authentication scheme.

Parameters:
scheme - The auth scheme for these credentials.

getAuthParameter

public java.lang.String getAuthParameter(java.lang.String name)
Get an authentication parameter.

Parameters:
name - The name of the parameter to fetch.
Returns:
The String value, or null if undefined.

setAuthParameter

public void setAuthParameter(java.lang.String name,
                             java.lang.String value,
                             boolean quoted)
Set an auth parameter value.

Parameters:
name - The name of the parameter to set.
value - The new value for this parameter.
quoted - If true, the value will be quoted

setAuthParameter

public void setAuthParameter(java.lang.String name,
                             java.lang.String value)
Set an auth parameter value.

Parameters:
name - The name of the parameter to set.
value - The new value for this parameter. The value will be quoted