public static class FileUploadHelper.UploadFileWrapper extends Object implements IUploadFileWrapper
| Constructor and Description |
|---|
UploadFileWrapper(FileItem fileItem) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete()
删除文件
|
byte[] |
get()
获取文件内容,将其存储在字节数组中(不适合对大文件操作)
|
String |
getContentType()
获取文件Content-Type
|
File |
getFile()
获取临时文件对象
|
InputStream |
getInputStream()
获取文件输入流对象
|
String |
getName()
获取文件名称
|
OutputStream |
getOutputStream()
获取文件输出流对象
|
String |
getPath()
获取完整的文件名及路径
|
long |
getSize()
获取文件大小
|
void |
transferTo(File dest)
转移文件
|
void |
writeTo(File file)
保存文件
|
public String getPath()
IUploadFileWrappergetPath in interface IUploadFileWrapperpublic String getName()
IUploadFileWrappergetName in interface IUploadFileWrapperpublic byte[] get()
public void delete()
IUploadFileWrapperdelete in interface IUploadFileWrapperpublic void transferTo(File dest) throws Exception
IUploadFileWrappertransferTo in interface IUploadFileWrapperdest - 目标Exception - 可能产生的异常public void writeTo(File file) throws Exception
IUploadFileWrapperwriteTo in interface IUploadFileWrapperfile - 目标Exception - 可能产生的异常public InputStream getInputStream() throws IOException
IUploadFileWrappergetInputStream in interface IUploadFileWrapperIOException - 可能产生的异常public long getSize()
IUploadFileWrappergetSize in interface IUploadFileWrapperpublic File getFile() throws Exception
IUploadFileWrappergetFile in interface IUploadFileWrapperException - 可能产生的异常public OutputStream getOutputStream() throws IOException
IUploadFileWrappergetOutputStream in interface IUploadFileWrapperIOException - 可能产生的异常public String getContentType()
IUploadFileWrappergetContentType in interface IUploadFileWrapperpublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2022. All rights reserved.