response.setCode(result.status.getCode());
response.setText(result.status.getDescription());
for (Entry<String, String> header : result.additionalStringHeaders.entrySet()) {
response.set(header.getKey(), header.getValue());
}
IOUtils.copy(result.inputStream(), response.getOutputStream());
}
catch (Exception e) {
LOG.error("Failed to respond to request for resource " + request.getPath().getPath(), e);
response.setCode(Status.NOT_FOUND.getCode());
response.setText(Status.NOT_FOUND.getDescription());