(no commit message)
[utils] / crawler / basic / src / org / wamblee / crawler / AbstractPageRequest.java
index 0c47430bd87b49af267bd82437c3e9dd4c1282ea..b37834bb2fa61b5c93ca18460b1d804274d2bcf3 100644 (file)
@@ -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.HttpException;
 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. 
-     * @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 {
+            throws IOException, TransformerException {
         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. 
+     * @throws IOException In case of IO problems. 
      * @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);
@@ -155,10 +156,6 @@ public abstract class AbstractPageRequest implements PageRequest {
                     _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 {