erland.util
Class CookieHandler

java.lang.Object
  extended by erland.util.CookieHandler
All Implemented Interfaces:
ParameterValueStorageInterface

public class CookieHandler
extends Object
implements ParameterValueStorageInterface

Makes it possible to read, write and delete cookies from an applet

Author:
Erland Isaksson

Field Summary
protected  Applet applet
          The applet object which will be used to access the cookies
 
Constructor Summary
CookieHandler(Applet applet)
           
 
Method Summary
protected  String cleanValue(String value)
           
protected  void deleteCookie(String name)
          Delete a cookie
 void delParameter(String name)
          Delete a parameter
protected  String getCookie()
          Reads all available cookies
protected  String getCookie(String name)
          Read a cookie
 String getParameter(String name)
          Get a parameter value
protected  void setCookie(String name, String value)
          Write a cookie
 void setParameter(String name, String value)
          Set a parameter value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applet

protected Applet applet
The applet object which will be used to access the cookies

Constructor Detail

CookieHandler

public CookieHandler(Applet applet)
Parameters:
applet - The applet object which should be used to access the cookies
Method Detail

getCookie

protected String getCookie()
Reads all available cookies

Returns:
The complete cookie string

getCookie

protected String getCookie(String name)
Read a cookie

Parameters:
name - The name of the cookie
Returns:
The value of the cookie, if the cookie does not exist it will return an empty string

cleanValue

protected String cleanValue(String value)

setCookie

protected void setCookie(String name,
                         String value)
Write a cookie

Parameters:
name - The name of the cookie
value - The value to write

deleteCookie

protected void deleteCookie(String name)
Delete a cookie

Parameters:
name - The name of the cookie

getParameter

public String getParameter(String name)
Description copied from interface: ParameterValueStorageInterface
Get a parameter value

Specified by:
getParameter in interface ParameterValueStorageInterface
Parameters:
name - The name of the parameter
Returns:
The value of the parameter, will be an empty string if the parameter does not exist

setParameter

public void setParameter(String name,
                         String value)
Description copied from interface: ParameterValueStorageInterface
Set a parameter value

Specified by:
setParameter in interface ParameterValueStorageInterface
Parameters:
name - The name of the parameter
value - The value of the parameter

delParameter

public void delParameter(String name)
Description copied from interface: ParameterValueStorageInterface
Delete a parameter

Specified by:
delParameter in interface ParameterValueStorageInterface
Parameters:
name - The name of the parameter


Copyright © 2003-2005 Erland Isaksson. All Rights Reserved.