|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcn.dreampie.upload.MultipartRequest
public class MultipartRequest
A utility class to handle multipart/form-data requests,
the kind of requests that support file uploads. This class emulates the
interface of HttpRequest, making it familiar to use.
It uses a "push" model where any incoming files are read and saved directly
to disk in the constructor. If you wish to have more flexibility, e.g.
write the files to a database, use the "pull" model
MultipartParser instead.
MultipartParser| 字段摘要 | |
|---|---|
protected Hashtable<String,UploadedFile> |
files
|
protected Hashtable<String,List<String>> |
params
|
| 构造方法摘要 | |
|---|---|
MultipartRequest(HttpRequest request,
File saveDirectory,
int maxPostSize,
String encoding,
FileRenamer renamer,
String[] allows,
String[] denieds)
Constructs a new MultipartRequest to handle the specified request, saving any uploaded files to the given directory, and limiting the upload size to the specified length. |
|
MultipartRequest(HttpRequest request,
String saveDirectory)
Constructs a new MultipartRequest to handle the specified request, saving any uploaded files to the given directory, and limiting the upload size to 1 Megabyte. |
|
MultipartRequest(HttpRequest request,
String saveDirectory,
int maxPostSize)
Constructs a new MultipartRequest to handle the specified request, saving any uploaded files to the given directory, and limiting the upload size to the specified length. |
|
MultipartRequest(HttpRequest request,
String saveDirectory,
int maxPostSize,
FileRenamer renamer)
Constructs a new MultipartRequest to handle the specified request, saving any uploaded files to the given directory, and limiting the upload size to the specified length. |
|
MultipartRequest(HttpRequest request,
String saveDirectory,
int maxPostSize,
String encoding)
Constructs a new MultipartRequest to handle the specified request, saving any uploaded files to the given directory, and limiting the upload size to the specified length. |
|
MultipartRequest(HttpRequest request,
String saveDirectory,
int maxPostSize,
String encoding,
FileRenamer renamer)
Constructs a new MultipartRequest to handle the specified request, saving any uploaded files to the given directory, and limiting the upload size to the specified length. |
|
MultipartRequest(HttpRequest request,
String saveDirectory,
String encoding)
Constructs a new MultipartRequest to handle the specified request, saving any uploaded files to the given directory, and limiting the upload size to the specified length. |
|
| 方法摘要 | |
|---|---|
String |
getContentType(String name)
Returns the content type of the specified file (as supplied by the client browser), or null if the file was not included in the upload. |
File |
getFile(String name)
Returns a File object for the specified file saved on the server's filesystem, or null if the file was not included in the upload. |
Enumeration |
getFileNames()
Returns the names of all the uploaded files as an Enumeration of Strings. |
Hashtable<String,UploadedFile> |
getFiles()
Returns all File objects for the specified file saved on the server's filesystem |
String |
getFilesystemName(String name)
Returns the filesystem name of the specified file, or null if the file was not included in the upload. |
String |
getOriginalFileName(String name)
Returns the original filesystem name of the specified file (before any renaming policy was applied), or null if the file was not included in the upload. |
Hashtable<String,List<String>> |
getParams()
Returns all Param objects for the specified param saved on the server's filesystem |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected Hashtable<String,List<String>> params
protected Hashtable<String,UploadedFile> files
| 构造方法详细信息 |
|---|
public MultipartRequest(HttpRequest request,
String saveDirectory)
throws IOException
request - the servlet request.saveDirectory - the directory in which to save any uploaded files.
IOException - if the uploaded content is larger than 1 Megabyte
or there's a problem reading or parsing the request.
public MultipartRequest(HttpRequest request,
String saveDirectory,
int maxPostSize)
throws IOException
request - the servlet request.saveDirectory - the directory in which to save any uploaded files.maxPostSize - the maximum size of the POST content.
IOException - if the uploaded content is larger than
maxPostSize or there's a problem reading or parsing the request.
public MultipartRequest(HttpRequest request,
String saveDirectory,
String encoding)
throws IOException
request - the servlet request.saveDirectory - the directory in which to save any uploaded files.encoding - the encoding of the response, such as ISO-8859-1
IOException - if the uploaded content is larger than
1 Megabyte or there's a problem reading or parsing the request.
public MultipartRequest(HttpRequest request,
String saveDirectory,
int maxPostSize,
FileRenamer renamer)
throws IOException
request - the servlet request.saveDirectory - the directory in which to save any uploaded files.maxPostSize - the maximum size of the POST content.renamer - change file name
IOException - if the uploaded content is larger than
maxPostSize or there's a problem reading or parsing the request.
public MultipartRequest(HttpRequest request,
String saveDirectory,
int maxPostSize,
String encoding)
throws IOException
request - the servlet request.saveDirectory - the directory in which to save any uploaded files.maxPostSize - the maximum size of the POST content.encoding - the encoding of the response, such as ISO-8859-1
IOException - if the uploaded content is larger than
maxPostSize or there's a problem reading or parsing the request.
public MultipartRequest(HttpRequest request,
String saveDirectory,
int maxPostSize,
String encoding,
FileRenamer renamer)
throws IOException
request - the servlet request.saveDirectory - the directory in which to save any uploaded files.maxPostSize - the maximum size of the POST content.encoding - the encoding of the response, such as ISO-8859-1renamer - a pluggable file rename policy
IOException - if the uploaded content is larger than
maxPostSize or there's a problem reading or parsing the request.
public MultipartRequest(HttpRequest request,
File saveDirectory,
int maxPostSize,
String encoding,
FileRenamer renamer,
String[] allows,
String[] denieds)
throws IOException
request - the servlet request.saveDirectory - the directory in which to save any uploaded files.maxPostSize - the maximum size of the POST content.encoding - the encoding of the response, such as ISO-8859-1renamer - a pluggable file rename renamer
IOException - if the uploaded content is larger than
maxPostSize or there's a problem reading or parsing the request.| 方法详细信息 |
|---|
public Enumeration getFileNames()
public String getFilesystemName(String name)
name - the file name.
public String getOriginalFileName(String name)
name - the file name.
public String getContentType(String name)
name - the file name.
public File getFile(String name)
name - the file name.
public Hashtable<String,UploadedFile> getFiles()
public Hashtable<String,List<String>> getParams()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||