|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceRequest
A ResourceRequest is a generic interface to a network resource such as an HTTP URL.
Method Summary | |
---|---|
int |
getContentLength()
Return the conent length of this request or -1 if not known. |
String |
getEtag()
The HTTP ETag to use with If-None-Match |
boolean |
getFollowRedirects()
|
String |
getHeaderField(String name)
Get a given response header. |
long |
getIfModifiedSince()
Set the If-Modified-Since header for HTTP URL connections and protocols that support similar operation. |
InputStream |
getInputStream()
Get an input stream for this content. |
byte[] |
getInputStreamAsByteArray()
|
String |
getInputStreamAsString()
Get the given Input Stream as a String by calling read() until we have all the data locally. |
InputStream |
getLocalInputStream()
|
byte[] |
getLocalInputStreamAsByteArray()
|
String |
getRequestHeaderField(String name)
|
Iterator |
getRequestHeaderFields()
Get the names of all set request headers. |
String |
getResource()
Set the resource for this request. |
String |
getResourceFromRedirect()
Get the resource but make sure all redirects are taken into consideration. |
long |
getResponseCode()
Get and set an HTTP style response code. |
void |
init()
Perform all initialization and connection to the remote server. |
void |
setEtag(String etag)
|
void |
setEventListener(NetworkEventListener eventListener)
|
void |
setFollowRedirects(boolean v)
|
void |
setIfModifiedSince(long ifModifiedSince)
|
void |
setLocalCache(boolean v)
When true we cache getLocalInputStream() so that multiple requests are returned from local data. |
void |
setRequestHeaderField(String name,
String value)
Set a given request header such as UserAgent, ETag, etc. |
void |
setRequestMethod(String method)
|
void |
setResource(String resource)
|
void |
setResponseCode(int responseCode)
|
void |
toOutputStream(OutputStream out)
Copy this input stream to an OutputStream |
Method Detail |
---|
void init() throws IOException
IOException
InputStream getInputStream() throws IOException
IOException
String getResource()
void setResource(String resource)
String getResourceFromRedirect()
String getInputStreamAsString() throws IOException
IOException
byte[] getInputStreamAsByteArray() throws IOException
IOException
InputStream getLocalInputStream() throws NetworkException
NetworkException
byte[] getLocalInputStreamAsByteArray() throws IOException
IOException
void setLocalCache(boolean v)
void toOutputStream(OutputStream out) throws IOException
IOException
long getIfModifiedSince()
void setIfModifiedSince(long ifModifiedSince)
String getEtag()
void setEtag(String etag)
long getResponseCode()
void setResponseCode(int responseCode)
int getContentLength() throws IOException
IOException
void setEventListener(NetworkEventListener eventListener)
String getHeaderField(String name)
void setRequestHeaderField(String name, String value)
Iterator getRequestHeaderFields()
String getRequestHeaderField(String name)
void setRequestMethod(String method) throws NetworkException
NetworkException
boolean getFollowRedirects()
void setFollowRedirects(boolean v)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |