Package com.logicaldoc.web
Class UploadServlet
- java.lang.Object
- 
- javax.servlet.GenericServlet
- 
- javax.servlet.http.HttpServlet
- 
- gwtupload.server.UploadServlet
- 
- gwtupload.server.UploadAction
- 
- com.logicaldoc.web.UploadServlet
 
 
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- javax.servlet.Servlet,- javax.servlet.ServletConfig
 
 public class UploadServlet extends gwtupload.server.UploadActionThis servlet is responsible for document uploads operations.- Since:
- 6.0
- Author:
- Marco Meschieri - LogicalDOC
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringRECEIVEDCONTENTTYPESstatic StringRECEIVEDFILENAMESstatic StringRECEIVEDFILES
 - 
Constructor SummaryConstructors Constructor Description UploadServlet()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckRequest(javax.servlet.http.HttpServletRequest request)static voidcleanReceivedFile(String sid, String entryName)static voidcleanReceivedFile(javax.servlet.http.HttpSession session, String entryName)static voidcleanReceivedFiles(String sid)static voidcleanReceivedFiles(javax.servlet.http.HttpSession session)StringexecuteAction(javax.servlet.http.HttpServletRequest request, List<org.apache.commons.fileupload.FileItem> sessionFiles)Override executeAction to save the received files in a custom place and delete this items from sessionstatic Map<String,String>getReceivedFileNames(javax.servlet.http.HttpServletRequest request, String sid)static Map<String,File>getReceivedFiles(javax.servlet.http.HttpServletRequest request, String sid)voidgetUploadedFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Get the content of an uploaded filestatic booleanisAllowedForUpload(String filename, String tenant)Checks if the passed filename can be uploaded or not on the basis of what configured in 'upload.disallow'voidremoveItem(javax.servlet.http.HttpServletRequest request, String fieldName)Remove a file when the user sends a delete request- 
Methods inherited from class gwtupload.server.UploadActiongetFileStream, getFormField, init, removeItem
 - 
Methods inherited from class gwtupload.server.UploadServletcancelUpload, copyFromInputStreamToOutputStream, findFileItem, findItemByFieldName, findItemByFileName, getInitParameter, getLastReceivedFileItems, getLastReceivedFileItems, getMessage, getMyLastReceivedFileItems, getMySessionFileItems, getSessionFileItems, getSessionFileItems, getSessionItems, getThreadLocalRequest, isAppEngine, removeSessionFileItems, removeSessionFileItems, removeSessionFileItems, removeSessionFileItems
 - 
Methods inherited from class javax.servlet.GenericServletdestroy, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
- 
 
- 
- 
- 
Method Detail- 
executeActionpublic String executeAction(javax.servlet.http.HttpServletRequest request, List<org.apache.commons.fileupload.FileItem> sessionFiles) throws gwtupload.server.exceptions.UploadActionException Override executeAction to save the received files in a custom place and delete this items from session- Overrides:
- executeActionin class- gwtupload.server.UploadAction
- Parameters:
- request- the HTTP request
- sessionFiles- list of file items
- Returns:
- always null
- Throws:
- gwtupload.server.exceptions.UploadActionException- error on the server handling the upload
 
 - 
checkRequestpublic void checkRequest(javax.servlet.http.HttpServletRequest request) - Overrides:
- checkRequestin class- gwtupload.server.UploadServlet
 
 - 
removeItempublic void removeItem(javax.servlet.http.HttpServletRequest request, String fieldName) throws gwtupload.server.exceptions.UploadActionExceptionRemove a file when the user sends a delete request- Overrides:
- removeItemin class- gwtupload.server.UploadAction
- Parameters:
- request- the HTTP request
- fieldName- name of the field
- Throws:
- gwtupload.server.exceptions.UploadActionException- error on the server handling the upload
 
 - 
getUploadedFilepublic void getUploadedFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOExceptionGet the content of an uploaded file- Overrides:
- getUploadedFilein class- gwtupload.server.UploadServlet
- Parameters:
- request- the HTTP request
- response- the server's response
- Throws:
- IOException- generic I/O error
 
 - 
getReceivedFilespublic static Map<String,File> getReceivedFiles(javax.servlet.http.HttpServletRequest request, String sid) 
 - 
getReceivedFileNamespublic static Map<String,String> getReceivedFileNames(javax.servlet.http.HttpServletRequest request, String sid) 
 - 
isAllowedForUploadpublic static boolean isAllowedForUpload(String filename, String tenant) Checks if the passed filename can be uploaded or not on the basis of what configured in 'upload.disallow'- Parameters:
- filename- name of the file
- tenant- name of the tenant
- Returns:
- true id the filename is allowed
 
 - 
cleanReceivedFilepublic static void cleanReceivedFile(javax.servlet.http.HttpSession session, String entryName)
 - 
cleanReceivedFilespublic static void cleanReceivedFiles(String sid) 
 - 
cleanReceivedFilespublic static void cleanReceivedFiles(javax.servlet.http.HttpSession session) 
 
- 
 
-