From 1da869140d826cd168d64c664b0606df20a9e19a Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Tue, 18 Dec 2012 17:19:36 +0200 Subject: Merge of (#9784) to Vaadin 7. Extracted static resource response writing to a separate, protected method. Change-Id: I5e2b5e86d6aa68e74193aaebb06cef3f9b70151a --- server/src/com/vaadin/server/VaadinServlet.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'server') diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index b099767b4f..fbb3750b3b 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -878,6 +878,23 @@ public class VaadinServlet extends HttpServlet implements Constants { response.setHeader("Cache-Control", cacheControl); } + writeStaticResourceResponse(request, response, resourceUrl); + } + + /** + * Writes the contents of the given resourceUrl in the response. Can be + * overridden to add/modify response headers and similar. + * + * @param request + * The request for the resource + * @param response + * The response + * @param resourceUrl + * The url to send + * @throws IOException + */ + protected void writeStaticResourceResponse(HttpServletRequest request, + HttpServletResponse response, URL resourceUrl) throws IOException { // Write the resource to the client. final OutputStream os = response.getOutputStream(); final byte buffer[] = new byte[DEFAULT_BUFFER_SIZE]; -- cgit v1.2.3