if (maxKeysStr != null)
maxKeys = Integer.parseInt(maxKeysStr);
Writer w = new Writer();
SortedMap<Entry, S3Object> submap = new TreeMap<Entry, S3Object>(map);
if (prefix != null)
submap = submap.tailMap(new Entry(prefix));
int keyCount = 0;
boolean truncated = false;
String nextMarker = null;
for (Entry e : submap.keySet()) {
if (++keyCount > maxKeys) {