|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.feedparser.network.BaseResourceRequest org.apache.commons.feedparser.network.URLResourceRequest
public class URLResourceRequest
ResourceRequest implementation that uses java.net.URL as the backend. Differences from other ResourceRequests. setRequestMethod() - Allows us to change the request type (HEAD, etc). getContentLength() - Returns the length/size of the content represented by this resource. Can be used by clients with setRequestMethod( "HEAD" ) to find the size of a remote resource without doing a full fetch.
Field Summary | |
---|---|
static String |
ACCEPT_ENCODING_HEADER
|
static boolean |
ENABLE_HTTP_DELTA_FEED_IM
Enable RFC 3228 HTTP Delta for feeds. |
static String |
GZIP_ENCODING
|
static String |
IF_NONE_MATCH_HEADER
|
static int |
MAX_CONTENT_LENGTH
|
static String |
REFERER
Not used anymore. |
static String |
USER_AGENT
|
static String |
USER_AGENT_HEADER
|
static String |
USER_AGENT_MOZILLA
|
Fields inherited from class org.apache.commons.feedparser.network.BaseResourceRequest |
---|
FOLLOW_REDIRECTS |
Constructor Summary | |
---|---|
URLResourceRequest()
|
Method Summary | |
---|---|
InputStream |
_getInputStream()
|
int |
getContentLength()
Return the conent length of this request or -1 if not known. |
String |
getHeaderField(String name)
Get a given response header. |
InputStream |
getInputStream()
Get an input stream for this content. |
String |
getResourceFromRedirect()
This method used Reflection to pull out the redirected URL in java.net.URL. |
void |
init()
Perform all initialization and connection to the remote server. |
void |
initConnection()
Init the actual connection. |
void |
setRequestMethod(String method)
Set the RequestMethod of this URLConnection. |
Methods inherited from class org.apache.commons.feedparser.network.BaseResourceRequest |
---|
fireDataEvent, fireDataEvent, fireInit, fireOnClosed, getEtag, getFollowRedirects, getIfModifiedSince, getInputStreamAsByteArray, getInputStreamAsString, getLocalInputStream, getLocalInputStreamAsByteArray, getRequestHeaderField, getRequestHeaderFields, getResource, getResponseCode, setEtag, setEventListener, setFollowRedirects, setIfModifiedSince, setLocalCache, setRequestHeaderField, setResource, setResponseCode, toOutputStream |
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 |
---|
getEtag, getFollowRedirects, getIfModifiedSince, getInputStreamAsByteArray, getInputStreamAsString, getLocalInputStream, getLocalInputStreamAsByteArray, getRequestHeaderField, getRequestHeaderFields, getResource, getResponseCode, setEtag, setEventListener, setFollowRedirects, setIfModifiedSince, setLocalCache, setRequestHeaderField, setResource, setResponseCode, toOutputStream |
Field Detail |
---|
public static final String ACCEPT_ENCODING_HEADER
public static final String IF_NONE_MATCH_HEADER
public static final String GZIP_ENCODING
public static final String USER_AGENT_HEADER
public static boolean ENABLE_HTTP_DELTA_FEED_IM
public static String USER_AGENT
public static String USER_AGENT_MOZILLA
public static final String REFERER
public static final int MAX_CONTENT_LENGTH
Constructor Detail |
---|
public URLResourceRequest()
Method Detail |
---|
public void init() throws IOException
ResourceRequest
init
in interface ResourceRequest
IOException
public void initConnection() throws NetworkException
NetworkException
public String getResourceFromRedirect()
getResourceFromRedirect
in interface ResourceRequest
getResourceFromRedirect
in class BaseResourceRequest
public InputStream getInputStream() throws NetworkException
ResourceRequest
getInputStream
in interface ResourceRequest
NetworkException
public InputStream _getInputStream() throws IOException
IOException
public void setRequestMethod(String method) throws NetworkException
setRequestMethod
in interface ResourceRequest
setRequestMethod
in class BaseResourceRequest
NetworkException
public int getContentLength() throws IOException
ResourceRequest
getContentLength
in interface ResourceRequest
getContentLength
in class BaseResourceRequest
IOException
public String getHeaderField(String name)
ResourceRequest
getHeaderField
in interface ResourceRequest
getHeaderField
in class BaseResourceRequest
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |