FsFile found = findFile();
return buildReadResponse(httpRequest, fs, found);
}
private static void setHeaders(FsFile found, ResponseBuilder response) {
FileData data = found.getData();
if (data.hasLastModified()) {
response.lastModified(new Date(data.getLastModified()));
}
if (data.hasHash()) {
response.header(HttpHeaders.ETAG, Hex.toHex(data.getHash().toByteArray()));
}
if (data.hasContentType()) {
response.header(HttpHeaders.CONTENT_TYPE, data.getContentType());
}
if (data.hasAttributes()) {
Attributes attributes = data.getAttributes();
for (KeyValueData entry : attributes.getUserAttributesList()) {
response.header(OBJECT_META_PREFIX + entry.getKey(), entry.getValue());
}
}
}