for(Path path : paths) {
Key startKey = null;
do {
RetryTask<QueryResult> queryTask = new RetryTask(new QueryTask(path, startKey), retryCount, timeout);
QueryResult result = queryTask.call();
for(Map<String, AttributeValue> item : result.getItems()) {
FileInfo file = new FileInfo(new Path(scheme+":"+item.get(HASH_KEY).getS() +"/"+ item.get(RANGE_KEY).getS()));
if(item.containsKey(DELETE_MARKER)) {
file.setDeleted(Boolean.parseBoolean(item.get(DELETE_MARKER).getS()));
//@TODO: cleanup deleteMarker logic after deployed
if(!includeDeleted) {
continue;
}
}
if(item.containsKey(DIRECTORY_VALUE)) {
file.setDirectory(Boolean.parseBoolean((item.get(DIRECTORY_VALUE).getS())));
}
listing.add(file);
}
startKey = result.getLastEvaluatedKey();
} while(startKey != null);
}
return listing;
}