if ("/".equals(uri.getPath())) {
list(req, resp);
} else {
String key = uri.getPath().substring(1);
Entry e = new Entry(key);
S3Object obj = map.get(e);
if (debug)
log("map.get(" + key + ") = " + obj);
if (obj == null) {
resp.sendError(404, "Not here: " + e);
return;
}
Headers h = new Headers();
h = h.mergeMetadata(obj.getMetadata());
for (Map.Entry<String, List<String>> me : h.getHeaders().entrySet()) {
for (String v : me.getValue()) {
resp.setHeader(me.getKey(), v);
}
}
resp.getOutputStream().write(obj.getData());
}
}