@Override
protected ResourceResponse newResourceResponse(final Attributes attributes)
{
final ResourceResponse resourceResponse = new ResourceResponse();
final WebExternalResourceStream webExternalResourceStream =
new WebExternalResourceStream(path);
resourceResponse.setContentType(webExternalResourceStream.getContentType());
resourceResponse.setLastModified(webExternalResourceStream.lastModifiedTime());
resourceResponse.setFileName(path);
resourceResponse.setWriteCallback(new WriteCallback()
{
@Override
public void writeData(final Attributes attributes)
{
InputStream inputStream = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try
{
inputStream = webExternalResourceStream.getInputStream();
Streams.copy(inputStream, baos);
attributes.getResponse().write(baos.toByteArray());
}
catch (ResourceStreamNotFoundException rsnfx)
{