oldCount = Integer.parseInt(tokenizer.nextToken());
numRows = Integer.parseInt(tokenizer.nextToken());
metadataPrefix = tokenizer.nextToken();
set = 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("NewFileSystemOAICatalog.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;
ArrayList setIdentifiers = (ArrayList)setMap.get(set);
while (count < maxListSize && iterator.hasNext()) {
Map.Entry entryDateMap = (Map.Entry)iterator.next();
String path = (String)entryDateMap.getKey();
if (setIdentifiers == null || setIdentifiers.contains(path)) {
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. */