com.noelios.restlet.http
Class HeaderReader

java.lang.Object
  extended by com.noelios.restlet.http.HeaderReader
Direct Known Subclasses:
CookieReader, PreferenceReader

public class HeaderReader
extends java.lang.Object

HTTP-style header reader.

Author:
Jerome Louvel

Constructor Summary
HeaderReader(java.lang.String header)
          Constructor.
 
Method Summary
protected  void appendQuotedString(java.lang.Appendable buffer)
          Appends the next quoted string.
protected  boolean isLinearWhiteSpace(int character)
          Indicates if the given character is a value separator.
protected  boolean isValueSeparator(int character)
          Indicates if the given character is a value separator.
 int read()
          Reads the next character.
protected  java.lang.String readQuotedString()
          Reads the next quoted string.
 java.lang.String readValue()
          Read the next value of a multi-value header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderReader

public HeaderReader(java.lang.String header)
Constructor.

Parameters:
header - The header to read.
Method Detail

appendQuotedString

protected void appendQuotedString(java.lang.Appendable buffer)
                           throws java.io.IOException
Appends the next quoted string.

Parameters:
buffer - The buffer to append.
Throws:
java.io.IOException

isLinearWhiteSpace

protected boolean isLinearWhiteSpace(int character)
Indicates if the given character is a value separator.

Parameters:
character - The character to test.
Returns:
True if the given character is a value separator.

isValueSeparator

protected boolean isValueSeparator(int character)
Indicates if the given character is a value separator.

Parameters:
character - The character to test.
Returns:
True if the given character is a value separator.

read

public int read()
Reads the next character.

Returns:
The next character.

readQuotedString

protected java.lang.String readQuotedString()
                                     throws java.io.IOException
Reads the next quoted string.

Returns:
The next quoted string.
Throws:
java.io.IOException

readValue

public java.lang.String readValue()
Read the next value of a multi-value header. It skips separator commas and spaces.

Returns:
The next value or null.
See Also:
HTTP parsing rule


Copyright © 2005-2008 Noelios Technologies.