use of com.tvd12.ezyhttp.server.core.request.RequestArguments in project ezyhttp by youngmonkeys.
the class BlockingServlet method handleException.
protected void handleException(HttpMethod method, RequestArguments arguments, Exception e) {
UncaughtExceptionHandler handler = getUncaughtExceptionHandler(e.getClass());
HttpServletRequest request = arguments.getRequest();
HttpServletResponse response = arguments.getResponse();
Exception exception = e;
if (handler != null) {
try {
Object result = handler.handleException(arguments, e);
if (result != null) {
String responseContentType = handler.getResponseContentType();
if (responseContentType != null) {
response.setContentType(responseContentType);
}
handleResponseData(request, response, result);
} else {
handleError(method, request, response, HttpServletResponse.SC_BAD_REQUEST);
}
exception = null;
} catch (Exception ex) {
exception = ex;
}
}
if (exception != null) {
handleError(method, request, response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, exception);
}
}
use of com.tvd12.ezyhttp.server.core.request.RequestArguments in project ezyhttp by youngmonkeys.
the class FileUploadService method download.
public void download(RequestArguments requestArguments, String file) throws Exception {
ResourceRequestHandler handler = new ResourceRequestHandler("files/" + file, "files/" + file, EzyFileUtil.getFileExtension(file), resourceDownloadManager);
handler.handle(requestArguments);
}
Aggregations