|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.feedparser.network.BaseResourceRequest
public abstract class BaseResourceRequest
| Field Summary | |
|---|---|
static boolean |
FOLLOW_REDIRECTS
|
| Constructor Summary | |
|---|---|
BaseResourceRequest()
|
|
| Method Summary | |
|---|---|
void |
fireDataEvent(DataEvent event)
Fire a new ArchiveEvent |
void |
fireDataEvent(long count)
Fire a new ArchiveEvent |
void |
fireInit()
|
void |
fireOnClosed()
|
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. |
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()
Get the value of resource. |
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 |
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)
Set the value of resource. |
void |
setResponseCode(int responseCode)
|
void |
toOutputStream(OutputStream out)
Copy this resource request to the given OutputStream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.commons.feedparser.network.ResourceRequest |
|---|
getInputStream, init |
| Field Detail |
|---|
public static boolean FOLLOW_REDIRECTS
| Constructor Detail |
|---|
public BaseResourceRequest()
| Method Detail |
|---|
public String getResource()
resource.
getResource in interface ResourceRequestpublic void setResource(String resource)
resource.
setResource in interface ResourceRequestpublic void fireDataEvent(long count)
public void fireInit()
public void fireDataEvent(DataEvent event)
public void fireOnClosed()
public String getInputStreamAsString()
throws IOException
ResourceRequest
getInputStreamAsString in interface ResourceRequestIOExceptionResourceRequest
public byte[] getInputStreamAsByteArray()
throws IOException
getInputStreamAsByteArray in interface ResourceRequestIOExceptionResourceRequest
public InputStream getLocalInputStream()
throws NetworkException
getLocalInputStream in interface ResourceRequestNetworkExceptionResourceRequest
public byte[] getLocalInputStreamAsByteArray()
throws IOException
getLocalInputStreamAsByteArray in interface ResourceRequestIOExceptionpublic void setLocalCache(boolean v)
ResourceRequest
setLocalCache in interface ResourceRequest
public void toOutputStream(OutputStream out)
throws IOException
toOutputStream in interface ResourceRequestIOExceptionpublic long getIfModifiedSince()
ResourceRequest
getIfModifiedSince in interface ResourceRequestpublic void setIfModifiedSince(long ifModifiedSince)
setIfModifiedSince in interface ResourceRequestpublic String getEtag()
ResourceRequest
getEtag in interface ResourceRequestpublic void setEtag(String etag)
setEtag in interface ResourceRequestpublic long getResponseCode()
getResponseCode in interface ResourceRequestpublic void setResponseCode(int responseCode)
setResponseCode in interface ResourceRequest
public int getContentLength()
throws IOException
ResourceRequest
getContentLength in interface ResourceRequestIOExceptionpublic void setEventListener(NetworkEventListener eventListener)
setEventListener in interface ResourceRequestpublic String getHeaderField(String name)
ResourceRequest
getHeaderField in interface ResourceRequest
public void setRequestHeaderField(String name,
String value)
ResourceRequest
setRequestHeaderField in interface ResourceRequestpublic Iterator getRequestHeaderFields()
ResourceRequest
getRequestHeaderFields in interface ResourceRequestpublic String getRequestHeaderField(String name)
getRequestHeaderField in interface ResourceRequest
public void setRequestMethod(String method)
throws NetworkException
setRequestMethod in interface ResourceRequestNetworkExceptionpublic boolean getFollowRedirects()
getFollowRedirects in interface ResourceRequestpublic void setFollowRedirects(boolean v)
setFollowRedirects in interface ResourceRequestpublic String getResourceFromRedirect()
ResourceRequest
getResourceFromRedirect in interface ResourceRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||