Package org.restlet.engine.header
Class CookieReader
- java.lang.Object
-
- org.restlet.engine.header.HeaderReader<Cookie>
-
- org.restlet.engine.header.CookieReader
-
public class CookieReader extends HeaderReader<Cookie>
Cookie header reader.
-
-
Field Summary
Fields Modifier and Type Field Description private intglobalVersionThe global cookie specification version.private static java.lang.StringNAME_DOMAINprivate static java.lang.StringNAME_PATHprivate static java.lang.StringNAME_VERSION
-
Constructor Summary
Constructors Constructor Description CookieReader(java.lang.String header)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Cookieread(java.lang.String cookie)Parses the given String to a Cookieprivate ParameterreadPair(boolean readAttribute)Reads the next pair as a parameter.CookiereadValue()Read the next value.-
Methods inherited from class org.restlet.engine.header.HeaderReader
addValues, canAdd, createParameter, createParameter, mark, peek, read, readActualNamedValue, readComment, readDate, readDigits, readHeader, readHeader, readNamedValue, readParameter, readQuotedString, readRawText, readRawValue, readToken, readValues, reset, skipParameterSeparator, skipSpaces, skipValueSeparator, unread
-
-
-
-
Field Detail
-
NAME_DOMAIN
private static final java.lang.String NAME_DOMAIN
- See Also:
- Constant Field Values
-
NAME_PATH
private static final java.lang.String NAME_PATH
- See Also:
- Constant Field Values
-
NAME_VERSION
private static final java.lang.String NAME_VERSION
- See Also:
- Constant Field Values
-
globalVersion
private volatile int globalVersion
The global cookie specification version.
-
-
Method Detail
-
read
public static Cookie read(java.lang.String cookie) throws java.lang.IllegalArgumentException
Parses the given String to a Cookie- Parameters:
cookie-- Returns:
- the Cookie parsed from the String
- Throws:
java.lang.IllegalArgumentException- Thrown if the String can not be parsed as Cookie.
-
readPair
private Parameter readPair(boolean readAttribute) throws java.io.IOException
Reads the next pair as a parameter.- Parameters:
readAttribute- True, if the intention is to read only cookie attribute.- Returns:
- The next pair as a parameter.
- Throws:
java.io.IOException
-
readValue
public Cookie readValue() throws java.io.IOException
Description copied from class:HeaderReaderRead the next value. There can be multiple values for a single header. Returns null by default.- Overrides:
readValuein classHeaderReader<Cookie>- Returns:
- The next value.
- Throws:
java.io.IOException
-
-