Package org.restlet.engine.header
Class CookieWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Cookie header writer.
- Author:
- Jerome Louvel
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends a list of cookies as an HTTP header.Appends a value.appendValue(String value, int version) Appends a source string as an HTTP comment.static voidGets the cookies whose name is a key in the given map.static StringWrites a cookie.static StringWrites a cookie.Methods inherited from class org.restlet.engine.header.HeaderWriter
append, append, append, append, append, append, appendComment, appendExtension, appendExtension, appendParameterSeparator, appendProduct, appendQuotedPair, appendQuotedString, appendSpace, appendToken, appendUriEncoded, appendValueSeparator, canWriteMethods inherited from class java.io.StringWriter
append, close, flush, getBuffer, toString, write, write, write, writeMethods inherited from class java.io.Writer
nullWriter, write
-
Constructor Details
-
CookieWriter
public CookieWriter()
-
-
Method Details
-
getCookies
Gets the cookies whose name is a key in the given map. If a matching cookie is found, its value is put in the map.- Parameters:
source- The source list of cookies.destination- The cookies map controlling the reading.
-
write
Writes a cookie.- Parameters:
cookie- The cookie to format.- Returns:
- The formatted cookie.
- Throws:
IllegalArgumentException- If the Cookie contains illegal values.
-
write
Writes a cookie.- Parameters:
cookies- The cookies to format.- Returns:
- The formatted cookie.
-
append
Description copied from class:HeaderWriterAppends a value.- Specified by:
appendin classHeaderWriter<Cookie>- Parameters:
cookie- The value.- Returns:
- This writer.
- Throws:
IllegalArgumentException
-
append
Appends a list of cookies as an HTTP header.- Parameters:
cookies- The list of cookies to format.- Returns:
- This writer.
-
appendValue
Appends a source string as an HTTP comment.- Parameters:
value- The source string to format.version- The cookie version.- Returns:
- This writer.
-