public class Cookie extends Object implements Externalizable
Modifier and Type | Field and Description |
---|---|
static String |
STORAGE_NAME |
Constructor and Description |
---|
Cookie() |
Modifier and Type | Method and Description |
---|---|
static void |
clearCookiesFromStorage()
Clears all cookies history from storage
|
void |
externalize(DataOutputStream out)
Allows us to store an object state, this method must be implemented
in order to save the state of an object
|
String |
getDomain() |
long |
getExpires() |
String |
getName() |
String |
getObjectId()
The object id must be unique, it is used to identify the object when loaded
even when it is obfuscated.
|
String |
getPath() |
String |
getValue() |
int |
getVersion()
Returns the version for the current persistance code, the version will be
pased to internalized thus allowing the internalize method to recognize
classes persisted in older revisions
|
void |
internalize(int version,
DataInputStream in)
Loads the object from the input stream and allows deserialization
|
static boolean |
isAutoStored()
Returns true if the Cookies are auto stored to storage
|
boolean |
isHttpOnly() |
boolean |
isSecure() |
static void |
setAutoStored(boolean autoStored)
This method configures the auto storage of cookies
|
void |
setDomain(String domain) |
void |
setExpires(long expires) |
void |
setHttpOnly(boolean httpOnly) |
void |
setName(String name) |
void |
setPath(String path) |
void |
setSecure(boolean secure) |
void |
setValue(String value) |
String |
toString()
Returns a string representation of the object.
|
public static String STORAGE_NAME
public String getName()
public void setName(String name)
name
- the name to setpublic void setSecure(boolean secure)
public boolean isSecure()
public void setHttpOnly(boolean httpOnly)
public boolean isHttpOnly()
public void setPath(String path)
public String getPath()
public String getValue()
public void setValue(String value)
value
- the value to setpublic String getDomain()
public void setDomain(String domain)
domain
- the domain to setpublic long getExpires()
public void setExpires(long expires)
expires
- the expires to setpublic int getVersion()
getVersion
in interface Externalizable
public void externalize(DataOutputStream out) throws IOException
externalize
in interface Externalizable
out
- the stream into which the object must be serializedIOException
- the method may throw an exceptionpublic void internalize(int version, DataInputStream in) throws IOException
internalize
in interface Externalizable
version
- the version the class returned during the externalization processsin
- the input stream used to load the classIOException
- the method may throw an exceptionpublic String getObjectId()
getObjectId
in interface Externalizable
public String toString()
public static void setAutoStored(boolean autoStored)
autoStored
- public static boolean isAutoStored()
public static void clearCookiesFromStorage()