|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.droids.helper.Loggable
org.apache.droids.protocol.HttpBase
public class HttpBase
Helper class that provides basic methods like returning the agent string and content type. Further can be used to prepare the connection.
Field Summary | |
---|---|
protected String |
from
|
protected String |
refer
|
protected int |
timeout
|
protected String |
userAgent
|
Fields inherited from class org.apache.droids.helper.Loggable |
---|
log |
Constructor Summary | |
---|---|
HttpBase()
|
Method Summary | |
---|---|
String |
getContentType(String url)
Will analyze and return the content type of the given url. |
String |
getFrom()
Returns the eMail address of the bot. |
String |
getRefer()
Return the refer URI where the bot is send from. |
int |
getTimeout()
Get the timeout we want for the connection. |
String |
getUserAgent()
Get the name of our UserAgent |
protected HttpURLConnection |
prepareConnection(URL source)
Will prepare a HttpURLConnection with the userAgent, from, the refer and the timeout |
void |
setFrom(String from)
Set the eMail address of the bot. |
void |
setRefer(String refer)
Set the refer URI where the bot is send from. |
void |
setTimeout(int timeout)
Set the timeout we want for the connection. |
void |
setUserAgent(String userAgent)
Set the name of our UserAgent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String userAgent
protected int timeout
protected String from
protected String refer
Constructor Detail |
---|
public HttpBase()
Method Detail |
---|
public String getContentType(String url)
url
- the url to determine the content type from.
protected HttpURLConnection prepareConnection(URL source) throws IOException
source
- the url to reach
IOException
public String getUserAgent()
public void setUserAgent(String userAgent)
userAgent
- the name of our UserAgentpublic int getTimeout()
public void setTimeout(int timeout)
timeout
- the timeout we want for the connection.public String getFrom()
public void setFrom(String from)
from
- the eMail address of the bot.public String getRefer()
public void setRefer(String refer)
refer
- the refer URI where the bot is send from. the refer URI
where the bot is send from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |