- public void service(HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- String fileName = request.getParameter(PARAM_FILE_NAME);
- String uri = request.getParameter(PARAM_FILE_URI);
+ public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ String fileName = request.getParameter(SingleSourcingConstants.PARAM_FILE_NAME);
+ String uri = request.getParameter(SingleSourcingConstants.PARAM_FILE_URI);
+
+ // Use buffered array to directly write the stream?
+ if (!uri.startsWith(SingleSourcingConstants.FILE_SCHEME))
+ throw new IllegalArgumentException(
+ "Open file service can only handle files that are on the server file system");