Resource resource = newClassPathResource(baseResourceLocation + path);
if (resource == null) {
throw new IllegalArgumentException(baseResourceLocation + path + ": resource is null");
}
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
resource.writeTo(outputStream, 0, resource.length());
resourceCache.put(baseResourceLocation + path, outputStream.toByteArray());
}
out.write(resourceCache.get(baseResourceLocation + path));
}
}