return getXmlDocument("pages");
}
private Document getXmlDocument(String documentType) throws IOException, SAXException {
String remotePathName = PathParser.render(remotePath);
RequestBuilder builder = new RequestBuilder("/" + remotePathName);
builder.addInput("responder", "proxy");
builder.addInput("type", documentType);
builder.setHostAndPort(remoteHostname, remotePort);
if (remoteUsername != null)
builder.addCredentials(remoteUsername, remotePassword);
ResponseParser parser = ResponseParser.performHttpRequest(remoteHostname, remotePort, builder);
if (parser.getStatus() == 404)
throw new IOException("The remote resource, " + remoteUrl() + ", was not found.");