|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.ws.rs.core.Cookie
javax.ws.rs.core.NewCookie
public class NewCookie
Used to create a new HTTP cookie, transferred in a response.
| Field Summary | |
|---|---|
static int |
DEFAULT_MAX_AGE
Specifies that the cookie expires with the current application/browser session. |
| Fields inherited from class javax.ws.rs.core.Cookie |
|---|
DEFAULT_VERSION |
| Constructor Summary | |
|---|---|
NewCookie(Cookie cookie)
Create a new instance copying the information in the supplied cookie. |
|
NewCookie(Cookie cookie,
String comment,
int maxAge,
boolean secure)
Create a new instance supplementing the information in the supplied cookie. |
|
NewCookie(Cookie cookie,
String comment,
int maxAge,
boolean secure,
boolean httpOnly)
Create a new instance supplementing the information in the supplied cookie. |
|
NewCookie(String name,
String value)
Create a new instance. |
|
NewCookie(String name,
String value,
String path,
String domain,
int version,
String comment,
int maxAge,
boolean secure)
Create a new instance. |
|
NewCookie(String name,
String value,
String path,
String domain,
int version,
String comment,
int maxAge,
boolean secure,
boolean httpOnly)
Create a new instance. |
|
NewCookie(String name,
String value,
String path,
String domain,
String comment,
int maxAge,
boolean secure)
Create a new instance. |
|
NewCookie(String name,
String value,
String path,
String domain,
String comment,
int maxAge,
boolean secure,
boolean httpOnly)
Create a new instance. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Compare for equality. |
String |
getComment()
Get the comment associated with the cookie. |
int |
getMaxAge()
Get the maximum age of the the cookie in seconds. |
int |
hashCode()
Generate a hash code by hashing all of the properties. |
boolean |
isHttpOnly()
Returns true if this cookie contains the HttpOnly attribute. |
boolean |
isSecure()
Whether the cookie will only be sent over a secure connection. |
Cookie |
toCookie()
Obtain a new instance of a Cookie with the same name, value, path,
domain and version as this NewCookie. |
String |
toString()
Convert the cookie to a string suitable for use as the value of the corresponding HTTP header. |
static NewCookie |
valueOf(String value)
Creates a new instance of NewCookie by parsing the supplied string. |
| Methods inherited from class javax.ws.rs.core.Cookie |
|---|
getDomain, getName, getPath, getValue, getVersion |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAX_AGE
| Constructor Detail |
|---|
public NewCookie(String name,
String value)
name - the name of the cookie.value - the value of the cookie.
IllegalArgumentException - if name is null.
public NewCookie(String name,
String value,
String path,
String domain,
String comment,
int maxAge,
boolean secure)
name - the name of the cookie.value - the value of the cookie.path - the URI path for which the cookie is valid.domain - the host domain for which the cookie is valid.comment - the comment.maxAge - the maximum age of the cookie in seconds.secure - specifies whether the cookie will only be sent over a secure connection.
IllegalArgumentException - if name is null.
public NewCookie(String name,
String value,
String path,
String domain,
String comment,
int maxAge,
boolean secure,
boolean httpOnly)
name - the name of the cookie.value - the value of the cookie.path - the URI path for which the cookie is valid.domain - the host domain for which the cookie is valid.comment - the comment.maxAge - the maximum age of the cookie in seconds.secure - specifies whether the cookie will only be sent over a secure connection.httpOnly - if true make the cookie HTTP only, i.e. only visible as part of an HTTP request.
IllegalArgumentException - if name is null.
public NewCookie(String name,
String value,
String path,
String domain,
int version,
String comment,
int maxAge,
boolean secure)
name - the name of the cookievalue - the value of the cookiepath - the URI path for which the cookie is validdomain - the host domain for which the cookie is validversion - the version of the specification to which the cookie compliescomment - the commentmaxAge - the maximum age of the cookie in secondssecure - specifies whether the cookie will only be sent over a secure connection
IllegalArgumentException - if name is null.
public NewCookie(String name,
String value,
String path,
String domain,
int version,
String comment,
int maxAge,
boolean secure,
boolean httpOnly)
name - the name of the cookievalue - the value of the cookiepath - the URI path for which the cookie is validdomain - the host domain for which the cookie is validversion - the version of the specification to which the cookie compliescomment - the commentmaxAge - the maximum age of the cookie in secondssecure - specifies whether the cookie will only be sent over a secure connectionhttpOnly - if true make the cookie HTTP only, i.e. only visible as part of an HTTP request.
IllegalArgumentException - if name is null.public NewCookie(Cookie cookie)
cookie - the cookie to clone.
IllegalArgumentException - if cookie is null.
public NewCookie(Cookie cookie,
String comment,
int maxAge,
boolean secure)
cookie - the cookie to clone.comment - the comment.maxAge - the maximum age of the cookie in seconds.secure - specifies whether the cookie will only be sent over a secure connection.
IllegalArgumentException - if cookie is null.
public NewCookie(Cookie cookie,
String comment,
int maxAge,
boolean secure,
boolean httpOnly)
cookie - the cookie to clone.comment - the comment.maxAge - the maximum age of the cookie in seconds.secure - specifies whether the cookie will only be sent over a secure connection.httpOnly - if true make the cookie HTTP only, i.e. only visible as part of an HTTP request.
IllegalArgumentException - if cookie is null.| Method Detail |
|---|
public static NewCookie valueOf(String value)
value - the cookie string.
NewCookie.
IllegalArgumentException - if the supplied string cannot be parsed
or is null.public String getComment()
public int getMaxAge()
-1 indicates
that the cookie will be discarded at the end of the browser/application session.
public boolean isSecure()
false.
true if the cookie will only be sent over a secure connection,
false otherwise.public boolean isHttpOnly()
true if this cookie contains the HttpOnly attribute.
This means that the cookie should not be accessible to scripting engines,
like javascript.
true if this cookie should be considered http only, false
otherwise.public Cookie toCookie()
Cookie with the same name, value, path,
domain and version as this NewCookie. This method can be used to
obtain an object that can be compared for equality with another Cookie;
since a Cookie will never compare equal to a NewCookie.
Cookiepublic String toString()
toString in class Cookiepublic int hashCode()
hashCode in class Cookiepublic boolean equals(Object obj)
toCookie() to compare a
NewCookie to a Cookie considering only the common
properties.
equals in class Cookieobj - the object to compare to
NewCookie with the same value for
all properties, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||