Iterator<Folder> itrChangedFolders = list.getChangedFolders().iterator();
Set<SPDocument> currentSet = new TreeSet<SPDocument>();
while (itrChangedFolders.hasNext()
&& currentSet.size() < sharepointClientContext.getBatchHint()) {
Folder changedFolder = itrChangedFolders.next();
LOGGER.log(Level.INFO, "Processing renamed/restored folder ["
+ changedFolder + "] ");
while (currentSet.size() < sharepointClientContext.getBatchHint()) {
List<SPDocument> currentListItems =
getListItemsUnderFolderHeirarchy(list, changedFolder);
int count = currentListItems.size();
LOGGER.log(Level.FINE, "found " + count
+ " items under folder [" + changedFolder + " ] ");
currentSet.addAll(currentListItems);
if (count == 0) {
changedFolder.setNextPage(null);
}
if (changedFolder.getNextPage() == null) {
break;
}
}
if (changedFolder.getNextPage() == null) {
itrChangedFolders.remove();
}
}
allItems.addAll(currentSet);
}