| Line 66... |
Line 66... |
| 66 |
}
|
66 |
}
|
| 67 |
|
67 |
|
| 68 |
public void writeOkFileContentType(HttpServletRequest request, HttpServletResponse response, File file, String contentType) throws Exception{
|
68 |
public void writeOkFileContentType(HttpServletRequest request, HttpServletResponse response, File file, String contentType) throws Exception{
|
| 69 |
response.setStatus(HttpStatus.OK.value());
|
69 |
response.setStatus(HttpStatus.OK.value());
|
| 70 |
response.setContentType(contentType);
|
70 |
response.setContentType(contentType);
|
| 71 |
response.getWriter().println(Files.readAllBytes(file.toPath()));
|
71 |
response.getOutputStream().write(Files.readAllBytes(file.toPath()));
|
| 72 |
response.getWriter().flush();
|
72 |
response.getOutputStream().flush();
|
| 73 |
}
|
73 |
}
|
| 74 |
|
74 |
|
| 75 |
public void writeUnauthorized(HttpServletRequest request, HttpServletResponse response, Response failedResponse) throws Exception{
|
75 |
public void writeUnauthorized(HttpServletRequest request, HttpServletResponse response, Response failedResponse) throws Exception{
|
| 76 |
this.writeGenericRequest(request, response, failedResponse, HttpStatus.UNAUTHORIZED);
|
76 |
this.writeGenericRequest(request, response, failedResponse, HttpStatus.UNAUTHORIZED);
|
| 77 |
}
|
77 |
}
|