private Response makeDeployFilePage(String target) { int secondSlash = target.indexOf('/', 1); if (secondSlash < 1) { return new ErrorPage("invalid URL for deploy file: " + target); } String rest = target.substring(secondSlash + 1); String allow = System.getProperty("allowed.policies"); if (allow == null || !rest.matches(allow)) { return new ErrorPage("invalid name for deploy file: " + rest); } File fileToSend = outboxes.findDeployFile(rest); if (fileToSend == null) { return new ErrorPage("Deploy file not found: " + rest); } return Responses.newFileResponse("text/plain", fileToSend); }