Package com.logicaldoc.web
Class UploadServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.logicaldoc.web.UploadServlet
-
- All Implemented Interfaces:
SessionListener
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class UploadServlet extends javax.servlet.http.HttpServlet implements SessionListener
This servlet is responsible for document resource upload. It receives the document resource and uploads it in LogicalDOC, inside the document's folder.- Since:
- 4.5
- Author:
- Matteo Caruso - LogicalDOC
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
RECEIVED_FILES
-
Constructor Summary
Constructors Constructor Description UploadServlet()
Constructor of the object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
cleanReceivedFiles(String sid)
Removes all the uploaded files from session and file system.static void
cleanReceivedFiles(javax.servlet.http.HttpSession httpSession)
Removes all the uploaded files from session and file system.static Map<String,File>
getReceivedFiles(String sid)
Retrieves the map containing the files uploaded in the current sessionstatic Map<String,File>
getReceivedFiles(javax.servlet.http.HttpSession httpSession)
Retrieves the map containing the files uploaded in the current sessionstatic File
getUploadDir(String sid)
Retrieves the root of the upload folderstatic File
getUploadDir(javax.servlet.http.HttpSession httpSession)
Retrieves the root of the upload foldervoid
onSessionClosed(Object sid)
void
onSessionCreated(Session session)
-
-
-
Field Detail
-
RECEIVED_FILES
public static final String RECEIVED_FILES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUploadDir
public static File getUploadDir(String sid)
Retrieves the root of the upload folder- Parameters:
sid
- The current session ID- Returns:
- the upload folder
-
getUploadDir
public static File getUploadDir(javax.servlet.http.HttpSession httpSession)
Retrieves the root of the upload folder- Parameters:
httpSession
- The current session- Returns:
- the upload folder
-
getReceivedFiles
public static Map<String,File> getReceivedFiles(String sid)
Retrieves the map containing the files uploaded in the current session- Parameters:
sid
- The current session ID- Returns:
- the files map where the key is the original file name and the value is the real file
-
getReceivedFiles
public static Map<String,File> getReceivedFiles(javax.servlet.http.HttpSession httpSession)
Retrieves the map containing the files uploaded in the current session- Parameters:
httpSession
- The current session- Returns:
- the files map where the key is the original file name and the value is the real file
-
cleanReceivedFiles
public static void cleanReceivedFiles(String sid)
Removes all the uploaded files from session and file system.- Parameters:
sid
- The current session ID
-
cleanReceivedFiles
public static void cleanReceivedFiles(javax.servlet.http.HttpSession httpSession)
Removes all the uploaded files from session and file system.- Parameters:
httpSession
- The current session
-
onSessionCreated
public void onSessionCreated(Session session)
- Specified by:
onSessionCreated
in interfaceSessionListener
-
onSessionClosed
public void onSessionClosed(Object sid)
- Specified by:
onSessionClosed
in interfaceSessionListener
-
-