File appFile = null;
String contentType = request.getContentType();
if (contentType != null && contentType.toLowerCase().startsWith("multipart/form-data")) {
RequestFacadeImpl facade = new RequestFacadeImpl(request);
MultiPartHandler multiReq = new MultiPartHandler(facade, usagesDirPath, Utils.getMaxUploadSize());
try{
multiReq.parseMultipartUpload();
// the file is uploaded as arguments "logs"
appFile = multiReq.getFile("logs"); // NOI18N
}catch(SocketTimeoutException ste){
LOG.severe(ste.getMessage());
response.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT);
return;
}finally{
facade.getInput().getInputStream().close();
}
}
if (appFile != null){
String ip = request.getHeader("x-forwarded-for");
if (ip == null){