git://wamblee.org
/
utils
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
960e81f
)
(no commit message)
author
Erik Brakkee
<erik@brakkee.org>
Fri, 17 Mar 2006 22:50:39 +0000
(22:50 +0000)
committer
Erik Brakkee
<erik@brakkee.org>
Fri, 17 Mar 2006 22:50:39 +0000
(22:50 +0000)
crawler/basic/src/org/wamblee/crawler/AbstractPageRequest.java
patch
|
blob
|
history
crawler/basic/src/org/wamblee/crawler/GetPageRequest.java
patch
|
blob
|
history
crawler/basic/src/org/wamblee/crawler/PostPageRequest.java
patch
|
blob
|
history
diff --git
a/crawler/basic/src/org/wamblee/crawler/AbstractPageRequest.java
b/crawler/basic/src/org/wamblee/crawler/AbstractPageRequest.java
index 0c47430bd87b49af267bd82437c3e9dd4c1282ea..b37834bb2fa61b5c93ca18460b1d804274d2bcf3 100644
(file)
--- a/
crawler/basic/src/org/wamblee/crawler/AbstractPageRequest.java
+++ b/
crawler/basic/src/org/wamblee/crawler/AbstractPageRequest.java
@@
-31,7
+31,6
@@
import javax.xml.transform.stream.StreamResult;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
@@
-111,11
+110,12
@@
public abstract class AbstractPageRequest implements PageRequest {
* retries.
* @param aClient HTTP client to use.
* @param aMethod Method representing the request.
* retries.
* @param aClient HTTP client to use.
* @param aMethod Method representing the request.
- * @return XML document describing the response.
+ * @return XML document describing the response.
+ * @throws IOException In case of IO problems.
* @throws TransformerException In case transformation of the HTML to XML fails.
*/
protected Document executeMethod(HttpClient aClient, HttpMethod aMethod)
* @throws TransformerException In case transformation of the HTML to XML fails.
*/
protected Document executeMethod(HttpClient aClient, HttpMethod aMethod)
- throws TransformerException {
+ throws
IOException,
TransformerException {
int triesLeft = _maxTries;
while (triesLeft > 0) {
triesLeft--;
int triesLeft = _maxTries;
while (triesLeft > 0) {
triesLeft--;
@@
-136,10
+136,11
@@
public abstract class AbstractPageRequest implements PageRequest {
* @param aClient HTTP client to use.
* @param aMethod Method to execute.
* @return XML document containing the result.
* @param aClient HTTP client to use.
* @param aMethod Method to execute.
* @return XML document containing the result.
+ * @throws IOException In case of IO problems.
* @throws TransformerException In case transformation of the result to XML fails.
*/
protected Document executeMethodWithoutRetries(HttpClient aClient,
* @throws TransformerException In case transformation of the result to XML fails.
*/
protected Document executeMethodWithoutRetries(HttpClient aClient,
- HttpMethod aMethod) throws TransformerException {
+ HttpMethod aMethod) throws
IOException,
TransformerException {
try {
aMethod = executeWithRedirects(aClient, aMethod);
byte[] xhtmlData = getXhtml(aMethod);
try {
aMethod = executeWithRedirects(aClient, aMethod);
byte[] xhtmlData = getXhtml(aMethod);
@@
-155,10
+156,6
@@
public abstract class AbstractPageRequest implements PageRequest {
_os));
return transformed;
_os));
return transformed;
- } catch (HttpException e) {
- throw new RuntimeException(e.getMessage(), e);
- } catch (IOException e) {
- throw new RuntimeException(e.getMessage(), e);
} catch (TransformerConfigurationException e) {
throw new RuntimeException(e.getMessage(), e);
} finally {
} catch (TransformerConfigurationException e) {
throw new RuntimeException(e.getMessage(), e);
} finally {
diff --git
a/crawler/basic/src/org/wamblee/crawler/GetPageRequest.java
b/crawler/basic/src/org/wamblee/crawler/GetPageRequest.java
index 3da77b83899eac83a9cc2851300f4fb6b1cc9d61..2ce267ee828e72757efd2d5d22e0c7ea83dda963 100644
(file)
--- a/
crawler/basic/src/org/wamblee/crawler/GetPageRequest.java
+++ b/
crawler/basic/src/org/wamblee/crawler/GetPageRequest.java
@@
-16,6
+16,7
@@
package org.wamblee.crawler;
package org.wamblee.crawler;
+import java.io.IOException;
import java.io.PrintStream;
import javax.xml.transform.TransformerException;
import java.io.PrintStream;
import javax.xml.transform.TransformerException;
@@
-75,6
+76,8
@@
public class GetPageRequest extends AbstractPageRequest {
return executeMethod(aClient, method);
} catch (TransformerException e) {
throw new PageException(e.getMessage(), e);
return executeMethod(aClient, method);
} catch (TransformerException e) {
throw new PageException(e.getMessage(), e);
+ } catch (IOException e) {
+ throw new PageException(e.getMessage(), e);
}
}
}
}
diff --git
a/crawler/basic/src/org/wamblee/crawler/PostPageRequest.java
b/crawler/basic/src/org/wamblee/crawler/PostPageRequest.java
index 5fbc0e31c6642959cee5dcbc1147bc0ddac8751c..2bb7dc91a88a7ae9c66cca685fffe3d54fd00dfb 100644
(file)
--- a/
crawler/basic/src/org/wamblee/crawler/PostPageRequest.java
+++ b/
crawler/basic/src/org/wamblee/crawler/PostPageRequest.java
@@
-16,6
+16,7
@@
package org.wamblee.crawler;
package org.wamblee.crawler;
+import java.io.IOException;
import java.io.PrintStream;
import javax.xml.transform.TransformerException;
import java.io.PrintStream;
import javax.xml.transform.TransformerException;
@@
-68,6
+69,8
@@
public class PostPageRequest extends AbstractPageRequest {
return executeMethod(aClient, method);
} catch (TransformerException e) {
throw new PageException(e.getMessage(), e);
return executeMethod(aClient, method);
} catch (TransformerException e) {
throw new PageException(e.getMessage(), e);
+ } catch (IOException e) {
+ throw new PageException(e.getMessage(), e);
}
}
}
}