--- /dev/null
+/**\r
+ * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ */\r
+\r
+package com.pentila.entSavoie.servlet;\r
+\r
+import java.io.IOException;\r
+import java.io.InputStream;\r
+import java.io.OutputStream;\r
+\r
+\r
+import javax.servlet.http.HttpServletResponse;\r
+\r
+\r
+/**\r
+ * <a href="ServletResponseUtil.java.html"><b><i>View Source</i></b></a>\r
+ *\r
+ * @author Brian Wing Shun Chan\r
+ *\r
+ */\r
+public class ServletResponseServiceUtil {\r
+\r
+ public static void cleanUp(InputStream is){\r
+ getService().cleanUp(is);\r
+ }\r
+\r
+ public static void cleanUp(OutputStream os){\r
+ getService().cleanUp(os);\r
+ }\r
+ \r
+ public static void cleanUp(OutputStream os, InputStream is){\r
+ getService().cleanUp(os, is);\r
+ }\r
+\r
+ public static void sendFile(\r
+ HttpServletResponse response, String fileName, byte[] bytes)\r
+ throws IOException{\r
+ getService().sendFile(response, fileName, bytes);\r
+ }\r
+\r
+ public static void sendFile(\r
+ HttpServletResponse response, String fileName, byte[] bytes,\r
+ String contentType)\r
+ throws IOException{\r
+ getService().sendFile(response, fileName, bytes, contentType);\r
+ }\r
+ \r
+ public static void sendFile(\r
+ HttpServletResponse response, String fileName, byte[] bytes,\r
+ String contentType, String forceContentDisposition)\r
+ throws IOException{\r
+ getService().sendFile(response, fileName, bytes, contentType, forceContentDisposition);\r
+ }\r
+\r
+ public static void sendFile(\r
+ HttpServletResponse response, String fileName, InputStream is)\r
+ throws IOException{\r
+ getService().sendFile(response, fileName, is);\r
+ }\r
+\r
+ public static void sendFile(\r
+ HttpServletResponse response, String fileName, InputStream is,\r
+ String contentType)\r
+ throws IOException{\r
+ getService().sendFile(response, fileName, is, contentType);\r
+ }\r
+\r
+ public static void sendFile(\r
+ HttpServletResponse response, String fileName, InputStream is,\r
+ int contentLength, String contentType)\r
+ throws IOException{\r
+ getService().sendFile(response, fileName, is, contentLength, contentType);\r
+ }\r
+ \r
+ public static void sendFile(\r
+ HttpServletResponse response, String fileName, InputStream is,\r
+ int contentLength, String contentType, String forceContentDisposition)\r
+ throws IOException{\r
+ getService().sendFile(response, fileName, is, contentLength, contentType, forceContentDisposition);\r
+ }\r
+\r
+ public static void write(HttpServletResponse response, String s)\r
+ throws IOException{\r
+ getService().write(response, s);\r
+ }\r
+\r
+ public static void write(HttpServletResponse response, byte[] bytes)\r
+ throws IOException{\r
+ getService().write(response, bytes);\r
+ }\r
+\r
+ public static void write(\r
+ HttpServletResponse response, byte[] bytes, int contentLength)\r
+ throws IOException{\r
+ getService().write(response, bytes, contentLength);\r
+ }\r
+ public static void write(HttpServletResponse response, InputStream is)\r
+ throws IOException{\r
+ getService().write(response, is);\r
+ }\r
+\r
+ public static void write(\r
+ HttpServletResponse response, InputStream is, int contentLength)\r
+ throws IOException{\r
+ getService().write(response, is, contentLength);\r
+ }\r
+\r
+ public static void setHeaders(\r
+ HttpServletResponse response,\r
+ String fileName,\r
+ String contentType,\r
+ String forceContentDisposition){\r
+ getService().setHeaders(response, fileName, contentType, forceContentDisposition);\r
+ }\r
+ \r
+ public static ServletResponseService getService() {\r
+ if (_service == null) {\r
+ throw new RuntimeException("ServletResponseService is not set");\r
+ }\r
+\r
+ return _service;\r
+ }\r
+\r
+ public void setService(ServletResponseService service) {\r
+ _service = service;\r
+ }\r
+\r
+ private static ServletResponseService _service;\r
+\r
+\r
+\r
+}
\ No newline at end of file