package org.wamblee.crawler;
-import java.io.PrintStream;
+import java.io.IOException;
import javax.xml.transform.TransformerException;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;
import org.w3c.dom.Document;
+import org.wamblee.xml.XslTransformer;
/**
* Retrieving pages using the post method.
*/
public class PostPageRequest extends AbstractPageRequest {
- public PostPageRequest(int aMaxTries, int aMaxDelay, NameValuePair[] aParams, String aXslt) {
- super(aMaxTries, aMaxDelay, aParams, aXslt, null);
- }
-
- public PostPageRequest(int aMaxTries, int aMaxDelay, NameValuePair[] aParams, String aXslt,
- PrintStream aOs) {
- super(aMaxTries, aMaxDelay, aParams, aXslt, aOs);
+ /**
+ * Constructs the request.
+ * @param aMaxTries Maximum number of retries.
+ * @param aMaxDelay Maximum delay before executing the request.
+ * @param aParams Request parameters to use.
+ * @param aXslt XSLT to use.
+ */
+ public PostPageRequest(int aMaxTries, int aMaxDelay, NameValuePair[] aParams, String aXslt, XslTransformer aTransformer) {
+ super(aMaxTries, aMaxDelay, aParams, aXslt, aTransformer);
}
/*
try {
return executeMethod(aClient, method);
} catch (TransformerException e) {
- throw new PageException(e.getMessage(), e);
+ throw new PageException("Transformation problem for url " + aUrl, e);
+ } catch (IOException e) {
+ throw new PageException("Problem getting page " + aUrl, e);
}
}