Package org.opencms.ade.upload
Class CmsUploadBean
- java.lang.Object
-
- org.opencms.jsp.CmsJspBean
-
- org.opencms.ade.upload.CmsUploadBean
-
public class CmsUploadBean extends CmsJspBean
Bean to be used in JSP scriptlet code that provides access to the upload functionality.- Since:
- 8.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_UPLOAD_TIMEOUT
The default upload timeout.static java.lang.String
SESSION_ATTRIBUTE_LISTENER_ID
Key name for the session attribute that stores the id of the current listener.
-
Constructor Summary
Constructors Constructor Description CmsUploadBean(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
Constructor, with parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CmsUploadListener
getCurrentListener(CmsUUID listenerId)
Returns the listener for given CmsUUID.static java.lang.String
getNewResourceName(CmsObject cms, java.lang.String fileName, java.lang.String folder, boolean keepFileNames)
Returns the VFS path for the given filename and folder.void
setUploadDelay(int uploadDelay)
Sets the uploadDelay.java.lang.String
start()
Starts the upload.-
Methods inherited from class org.opencms.jsp.CmsJspBean
getCmsObject, getController, getJspContext, getMessage, getRequest, getRequestContext, getResponse, handleException, handleMissingFlexController, init, isNotInitialized, isSupressingExceptions, setContentType, setStatus, setSupressingExceptions
-
-
-
-
Field Detail
-
DEFAULT_UPLOAD_TIMEOUT
public static final int DEFAULT_UPLOAD_TIMEOUT
The default upload timeout.- See Also:
- Constant Field Values
-
SESSION_ATTRIBUTE_LISTENER_ID
public static final java.lang.String SESSION_ATTRIBUTE_LISTENER_ID
Key name for the session attribute that stores the id of the current listener.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsUploadBean
public CmsUploadBean(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsException
Constructor, with parameters.- Parameters:
context
- the JSP page context objectreq
- the JSP requestres
- the JSP response- Throws:
CmsException
- if something goes wrong
-
-
Method Detail
-
getCurrentListener
public static CmsUploadListener getCurrentListener(CmsUUID listenerId)
Returns the listener for given CmsUUID.- Parameters:
listenerId
- the uuid- Returns:
- the according listener
-
getNewResourceName
public static java.lang.String getNewResourceName(CmsObject cms, java.lang.String fileName, java.lang.String folder, boolean keepFileNames)
Returns the VFS path for the given filename and folder.- Parameters:
cms
- the cms objectfileName
- the filename to combine with the folderfolder
- the folder to combine with the filenamekeepFileNames
- skip file name translation if true- Returns:
- the VFS path for the given filename and folder
-
setUploadDelay
public void setUploadDelay(int uploadDelay)
Sets the uploadDelay.- Parameters:
uploadDelay
- the uploadDelay to set
-
start
public java.lang.String start()
Starts the upload.- Returns:
- the response String (JSON)
-
-