|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ClientletResponse
Represents a URL response such as an HTTP or file protocol response.
| Method Summary | |
|---|---|
java.lang.String |
getCharset()
Gets the charset specified with the content type. |
int |
getContentLength()
Gets the content length of the reponse. |
java.lang.String |
getContentType()
Gets the response content type. |
java.util.Date |
getDate()
Gets the value of the "Date" header. |
java.lang.String |
getHeader(java.lang.String name)
Gets a response header. |
java.util.Iterator |
getHeaderNames()
Gets an iterator of response header names. |
java.lang.String[] |
getHeaders(java.lang.String name)
Gets all values for a particular header. |
java.io.InputStream |
getInputStream()
Gets the response stream. |
java.lang.String |
getLastRequestMethod()
Gets the request method for the response URL. |
java.lang.String |
getMimeType()
Gets only the mime-type part of the content type, e.g. |
java.lang.Object |
getPersistentCachedObject(java.lang.ClassLoader classLoader)
If available, gets an object previously persisted along with the cached document. |
int |
getResponseCode()
Gets the HTTP response or status code. |
java.lang.String |
getResponseMessage()
Gets the HTTP response message. |
java.net.URL |
getResponseURL()
Gets the response URL. |
java.lang.Object |
getTransientCachedObject()
If available, gets an object previously cached in main memory associated with the response URL. |
int |
getTransientCachedObjectSize()
Gets the approximate size in bytes of the transient cached object previously associated with the response. |
boolean |
isCacheable()
Returns true only if the response is allowed to be cached. |
boolean |
isFromCache()
Returns true only if the response comes from a local cache. |
boolean |
isNewNavigationAction()
Returns true only if the response does not result from a reload, forward or back. |
boolean |
matches(java.lang.String mimeType,
java.lang.String[] fileExtension)
A convenience method used to match parameters provided against the response mime-type or the "file extension" of the response URL's file path. |
void |
setNewPersistentCachedObject(java.io.Serializable object)
Caches the object provided in persistent memory and associates it with the reponse URL, if caching is allowed. |
void |
setNewTransientCachedObject(java.lang.Object object,
int approxSize)
Caches an object in main memory, provided caching is allowed and there's enough memory to do so. |
| Method Detail |
|---|
java.net.URL getResponseURL()
java.lang.String getLastRequestMethod()
java.lang.String getHeader(java.lang.String name)
name - The header name.java.lang.String[] getHeaders(java.lang.String name)
name - The header name.java.util.Iterator getHeaderNames()
java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionjava.lang.String getContentType()
getMimeType()java.lang.String getMimeType()
getContentType()
boolean matches(java.lang.String mimeType,
java.lang.String[] fileExtension)
application/octet-stream,
content/unknown, or not provided.
mimeType - A mime type, e.g. application/x-acme.fileExtension - A collection of file extensions, each starting with a dot,
e.g. new String[] { ".acme", ".acm" }.
int getContentLength()
boolean isFromCache()
java.lang.String getCharset()
int getResponseCode()
throws java.io.IOException
java.io.IOException
java.lang.String getResponseMessage()
throws java.io.IOException
java.io.IOExceptionboolean isCacheable()
boolean isNewNavigationAction()
java.lang.Object getPersistentCachedObject(java.lang.ClassLoader classLoader)
classLoader - A class loader that can load an object
of the type expected.setNewPersistentCachedObject(Serializable)void setNewPersistentCachedObject(java.io.Serializable object)
object - A Serializable object.java.lang.Object getTransientCachedObject()
Note: Most callers should only use the persistent cached object
if isFromCache() returns true.
setNewTransientCachedObject(Object, int)
void setNewTransientCachedObject(java.lang.Object object,
int approxSize)
object - An object.approxSize - The approximate byte size the object
occupies in memory. Note that
values less than the size of
the response in bytes are assumed
to be in error.int getTransientCachedObjectSize()
Note: Most callers should only use the transient cached object
if isFromCache() returns true.
java.util.Date getDate()
null if the header is not available.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||