public class FileUpload extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FILEUPLOAD_ATTRIBUTE |
| Constructor and Description |
|---|
FileUpload(javax.servlet.http.HttpServletRequest req,
String savePath,
int fileMaxSize)
Constructor
|
FileUpload(javax.servlet.http.HttpServletRequest req,
String savePath,
int fileMaxSize,
String charset)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkSavePath(String path)
Method checkSavePath
Check if the path where to save files is valid
|
void |
disposeItems() |
File |
getFile(String n) |
String |
getFileContentType(String n) |
Map<String,org.apache.commons.fileupload.disk.DiskFileItem> |
getFileItems()
Returns the map of all
FileUpload objects keyed by the form field
name. |
Set<String> |
getFileNames()
Return an Iterator of parameters name
|
String |
getFileSystemName(String n) |
String |
getFormFieldName(String n) |
String |
getParameterContentType(String paramName)
Return the content type of a parameter
|
Map<String,List<String>> |
getParameterMap() |
Set<String> |
getParameterNames()
Return an Iterator of parameters name
|
String[] |
getParameterValues(String paramName)
Return the values of a parameter
|
protected void |
init()
Init the MultiPartReq object if it's actually null
|
void |
markFilesAsConsumed() |
protected void |
parseQueryString()
Parse a query String and create an Map of parameter/value
|
void |
setParameterMap(Map<String,List<String>> params) |
public static final String FILEUPLOAD_ATTRIBUTE
public FileUpload(javax.servlet.http.HttpServletRequest req,
String savePath,
int fileMaxSize)
throws IOException
req - savePath - the path where files should be savedfileMaxSize - the max size of file to uploadIOExceptionpublic FileUpload(javax.servlet.http.HttpServletRequest req,
String savePath,
int fileMaxSize,
String charset)
throws IOException
req - savePath - the path where files should be savedfileMaxSize - the max size of file to uploadcharset - The charset to use to decode the values (default = UTF-8)IOExceptionprotected void init()
throws IOException
IOExceptionpublic Set<String> getParameterNames()
public String[] getParameterValues(String paramName)
paramName - the name of the parameterpublic String getParameterContentType(String paramName)
paramName - the name of the parameterpublic Set<String> getFileNames()
public Map<String,org.apache.commons.fileupload.disk.DiskFileItem> getFileItems()
FileUpload objects keyed by the form field
name.FileUpload objects keyed by the form field
namepublic void markFilesAsConsumed()
protected boolean checkSavePath(String path)
path - the relative path where to save files topublic void disposeItems()
protected void parseQueryString()
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.