resumptionId = tokenizer.nextToken();
oldCount = Integer.parseInt(tokenizer.nextToken());
numRows = Integer.parseInt(tokenizer.nextToken());
metadataPrefix = tokenizer.nextToken();
} catch (NoSuchElementException e) {
throw new BadResumptionTokenException();
}
/* Get some more records from your database */
Iterator iterator = (Iterator)resumptionResults.remove(resumptionId);
if (iterator == null) {
System.out.println("FileSystemOAICatalog.listRecords: reuse of old resumptionToken?");
iterator = fileDateMap.entrySet().iterator();
for (int i = 0; i<oldCount; ++i)
iterator.next();
}
/* load the records ArrayLists. */
int count = 0;
while (count < maxListSize && iterator.hasNext()) {
Map.Entry entryDateMap = (Map.Entry)iterator.next();
try {
HashMap nativeItem = getNativeRecord((String)entryDateMap.getKey());
String record = constructRecord(nativeItem, metadataPrefix);
records.add(record);
count++;
} catch (CannotDisseminateFormatException e) {
/* the client hacked the resumptionToken beyond repair */
throw new BadResumptionTokenException();
} catch (IOException e) {
/* the file is probably missing */
throw new BadResumptionTokenException();
}
}
/* decide if you're done. */
if (iterator.hasNext()) {