[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit/cookies package.html,NONE,1.1 Cookie.java
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-11-03 17:37:41
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/cookies
In directory usw-pr-cvs1:/tmp/cvs-serv17912/src/com/meterware/httpunit/cookies
Modified Files:
Cookie.java
Added Files:
package.html
Log Message:
update JavaDoc
--- NEW FILE ---
<HTML><BODY>
<p>Classes to support cookie handling. Supports the HTTP state mechanism. The central class of this package is the
{@link com.meterware.httpunit.cookies.CookieJar}, which acts as a repository of
{@link com.meterware.httpunit.cookies.Cookie} objects. There are two main ways to get cookies into the
CookieJar. The first is to construct the CookieJar, passing a {@link com.meterware.httpunit.cookies.CookieSource}
to its constructor. This will cause the CookieJar to parse the Set-Cookie headers from the source object. The second is
to copy them from another CookieJar through use of the
{@link com.meterware.httpunit.cookies.CookieJar#updateCookies updateCookies(CookieJar)} method.</p>
<p>The CookieJar can also produce a Cookie header to be sent as part of a request.
The {@link com.meterware.httpunit.cookies.CookieJar#getCookieHeaderField} method
will select any cookies that it has which can be sent to the specified URL and assemble them into an appropriate header.</p>
</body></html>
Index: Cookie.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/cookies/Cookie.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Cookie.java 17 Oct 2002 23:50:49 -0000 1.1
+++ Cookie.java 3 Nov 2002 17:37:37 -0000 1.2
@@ -20,13 +20,12 @@
*
*******************************************************************************************************************/
import java.util.Map;
-import java.util.HashMap;
import java.util.Iterator;
import java.net.URL;
/**
- *
+ * An HTTP client-side cookie.
* @author <a href="mailto:rus...@ht...">Russell Gold</a>
**/
public class Cookie {
@@ -40,6 +39,9 @@
private String _domain;
+ /**
+ * Constructs a cookie w/o any domain or path restrictions.
+ */
Cookie( String name, String value ) {
_name = name;
_value = value;
@@ -59,21 +61,33 @@
}
+ /**
+ * Returns the name of this cookie.
+ */
public String getName() {
return _name;
}
+ /**
+ * Returns the value associated with this cookie.
+ */
public String getValue() {
return _value;
}
+ /**
+ * Returns the path to which this cookie is restricted.
+ */
public String getPath() {
return _path;
}
+ /**
+ * Returns the domain to which this cookie may be sent.
+ */
public String getDomain() {
return _domain;
}
|