public interface FileItem
限定符和类型 | 方法和说明 |
---|---|
void |
appendMessage(java.lang.String message)
处理过程中,要在上传完毕后提示前端的信息,常用于查到病毒但杀毒成功的信息。
|
java.lang.String |
getContentType()
返回文件的content type。
|
java.io.InputStream |
getInputStream()
Return an InputStream to read the contents of the file from.
|
java.util.Collection |
getMessages()
获取所有的前台提示信息。
|
java.lang.String |
getName()
返回multipart form中的参数名称.
|
java.lang.String |
getOriginalFilename()
返回客户端原始文件的文件名.
|
long |
getSize()
返回文件的大小(字节).
|
void |
saveAs(com.seeyon.ctp.common.file.model.CtpAbstractFile file)
Transfer the received file to the given destination file.
|
void |
setInputStream(java.io.InputStream stream)
改变上传的文件,用于使用清除病毒以后的流替换原上传的文件流。
|
java.lang.String getName()
null
or empty)java.lang.String getOriginalFilename()
This may contain path information depending on the browser used, but it typically will not with any other than Opera.
null
if not defined or
not availablejava.lang.String getContentType()
null
if not defined (or no file has
been chosen in the multipart form)long getSize()
java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
- in case of access errors (if the temporary store fails)void appendMessage(java.lang.String message)
message
- 提示信息。void setInputStream(java.io.InputStream stream) throws java.io.IOException
stream
- 新的文件流。java.io.IOException
java.util.Collection getMessages()
void saveAs(com.seeyon.ctp.common.file.model.CtpAbstractFile file) throws java.io.IOException, java.lang.IllegalStateException
This may either move the file in the filesystem, copy the file in the filesystem, or save memory-held contents to the destination file. If the destination file already exists, it will be deleted first.
If the file has been moved in the filesystem, this operation cannot be invoked again. Therefore, call this method just once to be able to work with any storage mechanism.
dest
- the destination filejava.io.IOException
- in case of reading or writing errorsjava.lang.IllegalStateException
- if the file has already been moved in the filesystem and is
not available anymore for another transfer