|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.cvsgrab.WebBrowser
public class WebBrowser
Emulates a web browser
Constructor Summary | |
---|---|
WebBrowser()
Constructor for WebBrowser |
Method Summary | |
---|---|
static String |
addQueryParam(String url,
String queryParam)
|
static String |
addQueryParam(String url,
String paramName,
String paramValue)
|
org.apache.commons.httpclient.HttpMethod |
executeMethod(org.apache.commons.httpclient.HttpMethod method,
String url)
Execute a http method |
static String |
forceFinalSlash(String s)
|
Document |
getDocument(org.apache.commons.httpclient.HttpMethod method,
String url)
Execute the method and gets the response as a xml document. |
Document |
getDocument(String url)
Execute the method and gets the response as a xml document. |
Document |
getDocumentFromSource(String docSource)
|
static WebBrowser |
getInstance()
|
static Properties |
getQueryParams(String urlQuery)
Extract the query parameters |
String |
getResponse(org.apache.commons.httpclient.HttpMethod method,
String url)
Gets the response from a method that has been executed |
void |
loadFile(org.apache.commons.httpclient.HttpMethod method,
File destFile,
String url)
|
void |
loadFile(String url,
File destFile)
|
static String |
removeFinalSlash(String s)
|
static String |
toQueryParams(Properties queryItems)
Converts the query items to a single query string |
void |
useMultithreading()
Allow simultaneous connections on different threads. |
void |
useProxy(String proxyHost,
int proxyPort,
String ntDomain,
String userName,
String password)
Use a proxy to bypass the firewall |
void |
useWebAuthentification(String userName,
String password)
Use authentification for the web server |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebBrowser()
Method Detail |
---|
public static WebBrowser getInstance()
public static String forceFinalSlash(String s)
public static String removeFinalSlash(String s)
public static String addQueryParam(String url, String queryParam)
public static String addQueryParam(String url, String paramName, String paramValue)
public static Properties getQueryParams(String urlQuery)
urlQuery
- The query section of the url. Must be of the form ? (optional) key1=value1&key2=value2
public static String toQueryParams(Properties queryItems)
queryItems
- The set of (key,value) for the query
public void useProxy(String proxyHost, int proxyPort, String ntDomain, String userName, String password)
proxyHost
- Host of the proxyproxyPort
- Port of the proxyproxyNTDomain
- NT domain for authentification on a MS proxyuserName
- Username (if authentification is required), or nullpassword
- Password (if authentification is required), or nullpublic void useWebAuthentification(String userName, String password)
userName
- The username to use on the web serverpassword
- The password to use on the web serverpublic void useMultithreading()
public org.apache.commons.httpclient.HttpMethod executeMethod(org.apache.commons.httpclient.HttpMethod method, String url)
method
- The methodurl
- The url called by the method, only useful for error reporting
public String getResponse(org.apache.commons.httpclient.HttpMethod method, String url)
method
- The methodurl
- The url called by the method, only useful for error reportingpublic Document getDocument(String url) throws Exception
method
- The methodurl
- The url called by the method, only useful for error reporting
Exception
public Document getDocument(org.apache.commons.httpclient.HttpMethod method, String url) throws Exception
method
- The methodurl
- The url called by the method, only useful for error reporting
Exception
public Document getDocumentFromSource(String docSource) throws Exception
Exception
public void loadFile(String url, File destFile) throws Exception
Exception
public void loadFile(org.apache.commons.httpclient.HttpMethod method, File destFile, String url) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |