public class UploadFile extends Object
| 构造器和说明 | 
|---|
| UploadFile(UploadFileHeader header,
          UploadSetting setting)构造 | 
| 限定符和类型 | 方法和说明 | 
|---|---|
| void | delete()从磁盘或者内存中删除这个文件 | 
| byte[] | getFileContent() | 
| InputStream | getFileInputStream() | 
| String | getFileName() | 
| UploadFileHeader | getHeader() | 
| boolean | isInMemory() | 
| boolean | isUploaded() | 
| protected boolean | processStream(MultipartRequestInputStream input)处理上传表单流,提取出文件 | 
| int | size() | 
| File | write(File destination)将上传的文件写入目标文件 写入后原临时文件会被删除 | 
| File | write(String destPath)将上传的文件写入指定的目标文件路径,自动创建文件 写入后原临时文件会被删除 | 
public UploadFile(UploadFileHeader header, UploadSetting setting)
header - 头部信息setting - 上传设置public void delete()
public File write(String destPath) throws IOException
destPath - 目标文件路径IOExceptionpublic File write(File destination) throws IOException
IOExceptionpublic byte[] getFileContent()
                      throws IOException
IOExceptionpublic InputStream getFileInputStream() throws IOException
IOExceptionpublic UploadFileHeader getHeader()
public String getFileName()
public int size()
public boolean isUploaded()
public boolean isInMemory()
protected boolean processStream(MultipartRequestInputStream input) throws IOException
input - 上传表单的流IOExceptionCopyright © 2021. All rights reserved.