|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.HttpState
A container for HTTP attributes that may persist from request
to request, such as Cookie
s and authentication
Credentials
.
Constructor Summary | |
HttpState()
Constructor for HttpState. |
Method Summary | |
void |
addCookie(Cookie cookie)
Add a cookie. |
void |
addCookies(Cookie[] newcookies)
Add zero or more cookies If any given cookie has already expired, deletes the corresponding existing cookie (if any). |
int |
getCookiePolicy()
|
Cookie[] |
getCookies()
Obtain an array of my Cookie s. |
Cookie[] |
getCookies(java.lang.String domain,
int port,
java.lang.String path,
boolean secure)
Obtain an array of my Cookie s that
match the given request parameters. |
Cookie[] |
getCookies(java.lang.String domain,
int port,
java.lang.String path,
boolean secure,
java.util.Date now)
Deprecated. use HttpState.getCookies(String, int, String, boolean) |
Credentials |
getCredentials(java.lang.String realm)
Get the Credentials for the given authentication realm. |
HttpConnectionManager |
getHttpConnectionManager()
Returns the httpConnectionManager. |
Credentials |
getProxyCredentials(java.lang.String realm)
Get the Credentials for the proxy with the given authentication realm. |
boolean |
purgeExpiredCookies()
Remove all of my Cookie s that
have expired according to the current
system time. |
boolean |
purgeExpiredCookies(java.util.Date date)
Remove all of my Cookie s that
have expired by the specified date. |
void |
setCookiePolicy(int policy)
|
void |
setCredentials(java.lang.String realm,
Credentials credentials)
Set the Credentials for the given authentication realm. |
void |
setHttpConnectionManager(HttpConnectionManager httpConnectionManager)
Sets the httpConnectionManager. |
void |
setProxyCredentials(java.lang.String realm,
Credentials credentials)
Set the for the proxy with the given authentication realm. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HttpState()
Method Detail |
public void addCookie(Cookie cookie)
cookie
- the Cookie
to addaddCookies(Cookie[])
public void addCookies(Cookie[] newcookies)
newcookies
- the Cookie
s to addaddCookie(Cookie)
public Cookie[] getCookies()
Cookie
s.
Cookie
s.getCookies(String, int, String, boolean, java.util.Date)
public Cookie[] getCookies(java.lang.String domain, int port, java.lang.String path, boolean secure, java.util.Date now)
Cookie
s that
match the given request parameters.
domain
- the request domainport
- the request portpath
- the request pathsecure
- true
when using HTTPSnow
- the Date
by which expiration is determined
Cookie
s.Cookie.matches(java.lang.String, int, java.lang.String, boolean, java.util.Date)
,
getCookies()
public Cookie[] getCookies(java.lang.String domain, int port, java.lang.String path, boolean secure)
Cookie
s that
match the given request parameters.
domain
- the request domainport
- the request portpath
- the request pathsecure
- true
when using HTTPS
Cookie
s.Cookie.matches(java.lang.String, int, java.lang.String, boolean, java.util.Date)
,
getCookies()
public boolean purgeExpiredCookies()
Cookie
s that
have expired according to the current
system time.
purgeExpiredCookies(java.util.Date)
public boolean purgeExpiredCookies(java.util.Date date)
Cookie
s that
have expired by the specified date.
Cookie.isExpired(java.util.Date)
,
purgeExpiredCookies()
public int getCookiePolicy()
public void setCookiePolicy(int policy)
public void setCredentials(java.lang.String realm, Credentials credentials)
null
, I'll use the given
credentials when no other Credentials
have
been supplied for the given challenging realm.
(I.e., use a null
realm to set the "default"
credentials.)
Any previous credentials for this realm will be overwritten.
realm
- the authentication realmcredentials
- the authentication credentials for the given realmgetCredentials(String)
,
setProxyCredentials(String, Credentials)
public Credentials getCredentials(java.lang.String realm)
null
.
realm
- the authentication realm
setCredentials(String, Credentials)
public void setProxyCredentials(java.lang.String realm, Credentials credentials)
null
, I'll use the given
credentials when no other Credentials
have
been supplied for the given challenging realm.
(I.e., use a null
realm to set the "default"
credentials.) Realms rarely make much sense with proxies, so
null
is normally a good choice here.
Any previous credentials for this realm will be overwritten.
realm
- the authentication realmcredentials
- the authentication credentials for the given realmgetProxyCredentials(String)
,
setCredentials(String, Credentials)
public Credentials getProxyCredentials(java.lang.String realm)
null
.
realm
- the authentication realm
setProxyCredentials(java.lang.String, org.apache.commons.httpclient.Credentials)
public java.lang.String toString()
toString
in class java.lang.Object
public HttpConnectionManager getHttpConnectionManager()
public void setHttpConnectionManager(HttpConnectionManager httpConnectionManager)
httpConnectionManager
- The httpConnectionManager to set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |