olegk 2004/12/20 03:50:55
Modified: httpclient/src/java/org/apache/commons/httpclient
HttpState.java
Log:
PR #32409 (HttpState should have methods for clearing all cookies and
credentials)
Contributed by Oleg Kalnichevski
Reviewed by Michael Becke
Revision Changes Path
1.38 +34 -4
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpState.java
Index: HttpState.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpState.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- HttpState.java 22 Sep 2004 23:36:10 -0000 1.37
+++ HttpState.java 20 Dec 2004 11:50:54 -0000 1.38
@@ -592,4 +592,34 @@
}
return sbResult.toString();
}
+
+ /**
+ * Clears all credentials.
+ */
+ public void clearCredentials() {
+ this.credMap.clear();
+ }
+
+ /**
+ * Clears all proxy credentials.
+ */
+ public void clearProxyCredentials() {
+ this.proxyCred.clear();
+ }
+
+ /**
+ * Clears all cookies.
+ */
+ public void clearCookies() {
+ this.cookies.clear();
+ }
+
+ /**
+ * Clears the state information (all cookies, credentials and proxy
credentials).
+ */
+ public void clear() {
+ clearCookies();
+ clearCredentials();
+ clearProxyCredentials();
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]