|
SMILA 1.0 API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.smila.connectivity.framework.crawler.web.http.HttpBase
public abstract class HttpBase
Common configurations and methods for HTTP protocol.
Field Summary | |
---|---|
protected Authentication |
_authentication
The authentication. |
protected int |
_connectTimeout
The connect timeout. |
protected boolean |
_cookiesEnabled
The cookies enabled. |
protected java.util.List<Header> |
_headers
The headers. |
protected int |
_maxLengthBytes
The max length bytes. |
protected java.lang.String |
_proxyHost
The proxy host. |
protected java.lang.String |
_proxyLogin
The proxy login. |
protected java.lang.String |
_proxyPassword
The proxy password. |
protected int |
_proxyPort
The proxy port. |
protected int |
_readTimeout
The read timeout. |
protected java.lang.String |
_referrer
The referrer. |
protected int |
_timeout
The timeout. |
protected boolean |
_useHttp11
Do we use HTTP/1.1? |
protected boolean |
_useProxy
The use proxy. |
protected java.lang.String |
_userAgent
The 'User-Agent' request header. |
static int |
BUFFER_SIZE
The Constant BUFFER_SIZE. |
Constructor Summary | |
---|---|
HttpBase()
Creates a new instance of HttpBase. |
Method Summary | |
---|---|
Configuration |
getConf()
Return the configuration used by this object. |
java.util.List<Header> |
getHeaders()
Returns list of request headers. |
HttpOutput |
getHttpOutput(Outlink link,
FilterProcessor filterProcessor)
Returns retrieved page information in the HttpOutput format. |
int |
getMaxLengthBytes()
Returns maximum length of document. |
java.lang.String |
getReferer()
Returns the Referrer header value. |
protected abstract Response |
getResponse(java.lang.String urlString)
Returns HttpResponse for the given URL. |
protected abstract Response |
getResponse(java.lang.String urlString,
FilterProcessor filterProcessor)
Returns HttpResponse for the given URL and filter processor. |
boolean |
getUseHttp11()
Returns whether HTTP version 1.1 will be used or not. |
java.lang.String |
getUserAgent()
Returns User-Agent value. |
boolean |
isCookiesEnabled()
Returns if cookies are enabled or not. |
byte[] |
processGzipEncoded(byte[] compressed,
java.lang.String url)
Holds uncompressing of GZIP content. |
void |
setConf(Configuration conf)
Loads configuration. |
void |
setCookiesEnabled(boolean enableCookies)
Assigns boolean value to enable or disable cookies. |
void |
setHeaders(java.util.List<Header> headersList)
Assigns list of request headers. |
void |
setReferer(java.lang.String refererValue)
Assigns the Referrer header value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUFFER_SIZE
protected java.lang.String _userAgent
protected java.lang.String _referrer
protected java.util.List<Header> _headers
protected boolean _useHttp11
protected java.lang.String _proxyHost
protected int _proxyPort
protected java.lang.String _proxyLogin
protected java.lang.String _proxyPassword
protected boolean _useProxy
protected int _maxLengthBytes
protected int _timeout
protected int _connectTimeout
protected int _readTimeout
protected Authentication _authentication
protected boolean _cookiesEnabled
Constructor Detail |
---|
public HttpBase()
Method Detail |
---|
public void setConf(Configuration conf)
conf
- Configurationpublic Configuration getConf()
public HttpOutput getHttpOutput(Outlink link, FilterProcessor filterProcessor)
link
- Out link to retrieve.filterProcessor
- FilterProcessor implementation
public byte[] processGzipEncoded(byte[] compressed, java.lang.String url) throws java.io.IOException
compressed
- GZIP byte arrayurl
- URL string
java.io.IOException
- if uncompressing error occurpublic java.lang.String getUserAgent()
public boolean getUseHttp11()
public int getMaxLengthBytes()
public java.util.List<Header> getHeaders()
public void setHeaders(java.util.List<Header> headersList)
headersList
- List of headerspublic java.lang.String getReferer()
public void setReferer(java.lang.String refererValue)
refererValue
- Stringpublic boolean isCookiesEnabled()
public void setCookiesEnabled(boolean enableCookies)
enableCookies
- booleanprotected abstract Response getResponse(java.lang.String urlString) throws java.io.IOException
urlString
- the url string
java.io.IOException
- if there was a error retrieving URL.protected abstract Response getResponse(java.lang.String urlString, FilterProcessor filterProcessor) throws java.io.IOException
filterProcessor
- filterProcessor implementationurlString
- the url string
java.io.IOException
- if there was a error retrieving URL.
|
SMILA 1.0 API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |