Class Cookie
- All Implemented Interfaces:
Externalizable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClears all cookies history from storagevoidAllows us to store an object state, this method must be implemented in order to save the state of an objectReturns
longReturns
getName()Returns
The object id must be unique, it is used to identify the object when loaded even when it is obfuscated.getPath()getValue()Returns
intReturns 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 revisionsvoidinternalize(int version, DataInputStream in) Loads the object from the input stream and allows deserializationstatic booleanReturns true if the Cookies are auto stored to storagebooleanbooleanisSecure()static voidsetAutoStored(boolean autoStored) This method configures the auto storage of cookiesvoidParameters
voidsetExpires(long expires) Parameters
voidsetHttpOnly(boolean httpOnly) voidParameters
voidvoidsetSecure(boolean secure) voidParameters
toString()
-
Field Details
-
STORAGE_NAME
- See Also:
-
-
Constructor Details
-
Cookie
public Cookie()
-
-
Method Details
-
isAutoStored
public static boolean isAutoStored()Returns true if the Cookies are auto stored to storage
Returns
autoStored
-
setAutoStored
public static void setAutoStored(boolean autoStored) This method configures the auto storage of cookies
Parameters
autoStored
-
clearCookiesFromStorage
public static void clearCookiesFromStorage()Clears all cookies history from storage -
getName
Returns
the name
-
setName
Parameters
name: the name to set
-
isSecure
public boolean isSecure() -
setSecure
public void setSecure(boolean secure) -
isHttpOnly
public boolean isHttpOnly() -
setHttpOnly
public void setHttpOnly(boolean httpOnly) -
getPath
-
setPath
-
getValue
Returns
the value
-
setValue
Parameters
value: the value to set
-
getDomain
Returns
the domain
-
setDomain
Parameters
domain: the domain to set
-
getExpires
public long getExpires()Returns
the expires
-
setExpires
public void setExpires(long expires) Parameters
expires: the expires to set
-
getVersion
public 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
Returns
version number for the persistant code
- Specified by:
getVersionin interfaceExternalizable
-
externalize
Allows us to store an object state, this method must be implemented in order to save the state of an object
Parameters
out: the stream into which the object must be serialized
Throws
java.io.IOException: the method may throw an exception
- Specified by:
externalizein interfaceExternalizable- Throws:
IOException
-
internalize
Loads the object from the input stream and allows deserialization
Parameters
-
version: the version the class returned during the externalization processs -
in: the input stream used to load the class
Throws
java.io.IOException: the method may throw an exception
- Specified by:
internalizein interfaceExternalizable- Throws:
IOException
-
-
getObjectId
The object id must be unique, it is used to identify the object when loaded even when it is obfuscated.
Returns
a unique id
- Specified by:
getObjectIdin interfaceExternalizable
-
toString
-