public interface FileUploadProvider
Modifier and Type | Method and Description |
---|---|
FileInformation |
getFileInformation(java.lang.String fieldName)
Get the file information of an uploaded file by field name.
The retrieved value will depend on the client's operating system: Windows delivers Full Path, *NX delivers only FileName |
long |
getMaxFilesize()
Get the maximum allowed filesize
|
java.lang.String |
getParameter(java.lang.String fieldName)
Get the value of a non-file parameter (similar to
PortletRequest.getParameter(java.lang.String) ) |
java.util.Map |
getParameterMap()
Get all non-file parameters as map (similar to
PortletRequest.getParameterMap() ) |
java.util.Enumeration |
getParameterNames()
Get all parameter names of non-file parameters (similar to
PortletRequest.getParameterNames() ) |
java.lang.String[] |
getParameterValues(java.lang.String fieldName)
Get values of a non-file parameter (similar to
PortletRequest.getParameterValues(java.lang.String) ) |
java.lang.String |
getRepositoryPath()
Returns the current repository path used for uploaded files.
|
int |
getSizeThreshold()
Returns the current max limit for files hold in memory.
|
java.io.InputStream |
getStream(java.lang.String fieldName)
Get an input stream for retrieving the file content by field name
|
void |
invalidate()
Called (by the portal) when the provided information is no longer needed.
|
java.io.File |
save(java.lang.String fieldName,
java.lang.String path)
TODO: difference to
saveAs(String, String) |
java.io.File |
saveAs(java.lang.String fieldName,
java.lang.String filePath)
Directly store the specified uploaded file into the filepath and return
the representing file object.
|
void |
setMaxFilesize(long maxFilesize)
Sets a max limit for a fileupload
|
void |
setRepositoryPath(java.lang.String repositoryPath)
Sets the repository path for the uploaded file
|
void |
setSizeThreshold(int sizeThreshold)
Sets a max limit for the size threshold.
|
void setMaxFilesize(long maxFilesize)
maxFilesize
- set max file size in bytesvoid setSizeThreshold(int sizeThreshold)
sizeThreshold
- in bytesint getSizeThreshold()
void setRepositoryPath(java.lang.String repositoryPath)
repositoryPath
- absolute Pathjava.lang.String getRepositoryPath()
java.io.InputStream getStream(java.lang.String fieldName) throws java.io.FileNotFoundException
fieldName
- name of the upload fieldjava.io.FileNotFoundException
- when the file was not found (field not
present in form)FileInformation getFileInformation(java.lang.String fieldName) throws java.io.FileNotFoundException, org.apache.commons.fileupload.FileUploadException
fieldName
- name of the upload fieldjava.io.FileNotFoundException
- when the file was not found (field not
present in form)org.apache.commons.fileupload.FileUploadException
- when the upload failsjava.lang.String getParameter(java.lang.String fieldName)
PortletRequest.getParameter(java.lang.String)
)fieldName
- name of the fieldjava.lang.String[] getParameterValues(java.lang.String fieldName)
PortletRequest.getParameterValues(java.lang.String)
)fieldName
- name of the fieldjava.util.Map getParameterMap()
PortletRequest.getParameterMap()
)java.util.Enumeration getParameterNames()
PortletRequest.getParameterNames()
)java.io.File save(java.lang.String fieldName, java.lang.String path) throws java.lang.Exception
saveAs(String, String)
fieldName
- fieldname of the uploaded filepath
- file path to save the filejava.lang.Exception
- an Execption ???java.io.File saveAs(java.lang.String fieldName, java.lang.String filePath) throws java.lang.Exception
fieldName
- ENTER FULL fieldName (e.g.: p.file)filePath
- ENTER ONLY PATH NAME (NO NEED TO ADD ANY '/' OR '\'java.lang.Exception
- an Execption ???void invalidate()
FileUploadProviderImpl.setHttpServletRequest(javax.servlet.http.HttpServletRequest)
by calling delete()
for all FileItemslong getMaxFilesize()
Copyright © 2019 Gentics Software. All Rights Reserved.