* @throws IOException if advancing fails
*/
private void advanceToNextRecords() throws IOException {
LOGGER.finer("Advancing to the next group of records.");
try {
HttpClientRequest cr = new HttpClientRequest();
cr.setUrl(info.newUrl(startIndex, itemsPerPage));
XmlHandler sh = new XmlHandler(true);
cr.setContentHandler(sh);
cr.setCredentialProvider(info.newCredentialProvider());
try{
cr.execute();
}catch (HttpClientException hcex){
if(hcex.getHttpStatusCode() == 404){
cr.setUrl(info.newUrl(-1, -1));
sh = new XmlHandler(true);
cr.setContentHandler(sh);
cr.setCredentialProvider(info.newCredentialProvider());
cr.execute();
noMore = true;
}
}
Document doc = sh.getDocument();
XPath xPath = XPathFactory.newInstance().newXPath();