src/com/mlhsoftware/commandline/network/CookieManager.java
public void storeCookies( String setCookieValue, String host )
  {
    String domain = getDomainFromHost( host );

    //set-cookie header may contain multiple cookie definition
    //The following method separates these cookies into a single Vector collection
    Vector cookies = parseSetCookie( setCookieValue );

    if ( cookies == null )
    {
      return;
    }

    int size = cookies.size();

    for ( int x = 0; x < size; x++ )
    {
      //Extract the cookie name-value pair from the full cookie string:
      String sCookieValue = cookies.elementAt( x ).toString();
      int indexEnd = sCookieValue.indexOf( COOKIE_VALUE_DELIMITER );

      if ( indexEnd >= 0 )
      {
        sCookieValue = sCookieValue.substring( 0, indexEnd );
      }

      //Check to see the Hashtable already contains cookies for the given domain:
      Vector cookieVector;

      if ( cookieJar.containsKey( domain ) )
      {
        cookieVector = (Vector)cookieJar.get( domain );
      }
      else
      {
        cookieVector = new Vector();
      }

      //Check to see if this cookie already exists in the Hashtable
      if ( cookieVector.contains( sCookieValue ) )
      {
      }
      else
      {
        cookieVector.addElement( sCookieValue );
      }

      //persist to memory
      cookieJar.put( domain, cookieVector );
    }
  }
/**
	 * Saves cookies to a Hashtable: <String,Vector> = <domain, cookies>
	 * 
   * @param setCookieValue
   *            - comma separated list of HTTP cookies (value of set-cookie HTTP response header)
   * @param host
   *            - used to retrieve the domain of the cookie(s)
   */
Saves cookies to a Hashtable:  = 

@param setCookieValue
- comma separated list of HTTP cookies (value of set-cookie HTTP response header)
@param host
- used to retrieve the domain of the cookie(s)
Saves cookies to a Hashtable : = @param setCookieValue - comma separated list of HTTP cookies ( value of set - cookie HTTP response header ) @param host - used to retrieve the domain of the cookie ( s )
public void storeCookies( String setCookieValue, String host )
  {
    String domain = getDomainFromHost( host );
    Vector cookies = parseSetCookie( setCookieValue );
    if ( cookies == null )
    {
      return;
    }
    int size = cookies.size();
    for ( int x = 0; x < size; x++ )
    {
      String sCookieValue = cookies.elementAt( x ).toString();
      int indexEnd = sCookieValue.indexOf( COOKIE_VALUE_DELIMITER );
      if ( indexEnd >= 0 )
      {
        sCookieValue = sCookieValue.substring( 0, indexEnd );
      }
      Vector cookieVector;
      if ( cookieJar.containsKey( domain ) )
      {
        cookieVector = (Vector)cookieJar.get( domain );
      }
      else
      {
        cookieVector = new Vector();
      }
      if ( cookieVector.contains( sCookieValue ) )
      {
      }
      else
      {
        cookieVector.addElement( sCookieValue );
      }
      cookieJar.put( domain, cookieVector );
    }
  }
public void storeCookies ( String setCookieValue , String host ) { String domain = getDomainFromHost ( host ) ; Vector cookies = parseSetCookie ( setCookieValue ) ; if ( cookies == null ) { return ; } int size = cookies . size ( ) ; for ( int x = 0 ; x < size ; x ++ ) { String sCookieValue = cookies . elementAt ( x ) . toString ( ) ; int indexEnd = sCookieValue . indexOf ( COOKIE_VALUE_DELIMITER ) ; if ( indexEnd >= 0 ) { sCookieValue = sCookieValue . substring ( 0 , indexEnd ) ; } Vector cookieVector ; if ( cookieJar . containsKey ( domain ) ) { cookieVector = ( Vector ) cookieJar . get ( domain ) ; } else { cookieVector = new Vector ( ) ; } if ( cookieVector . contains ( sCookieValue ) ) { } else { cookieVector . addElement ( sCookieValue ) ; } cookieJar . put ( domain , cookieVector ) ; } }
Saves cookies to a Hashtable: <String,Vector> = <domain, cookies>
Saves cookies to a Hashtable : <String Vector > = <domain cookies >
//set-cookie header may contain multiple cookie definition //The following method separates these cookies into a single Vector collection //Extract the cookie name-value pair from the full cookie string: //Check to see the Hashtable already contains cookies for the given domain: //Check to see if this cookie already exists in the Hashtable //persist to memory