com.seeyon.ctp.common.filemanager.event
接口 FileItem


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(java.io.File file)
          Transfer the received file to the given destination file.
 void setInputStream(java.io.InputStream stream)
          改变上传的文件,用于使用清除病毒以后的流替换原上传的文件流。
 

方法详细信息

getName

java.lang.String getName()
返回multipart form中的参数名称.

返回:
参数名称(never null or empty)

getOriginalFilename

java.lang.String getOriginalFilename()
返回客户端原始文件的文件名.

This may contain path information depending on the browser used, but it typically will not with any other than Opera.

返回:
the original filename, or the empty String if no file has been chosen in the multipart form, or null if not defined or not available

getContentType

java.lang.String getContentType()
返回文件的content type。

返回:
the content type, or null if not defined (or no file has been chosen in the multipart form)

getSize

long getSize()
返回文件的大小(字节).

返回:
the size of the file, or 0 if empty

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
Return an InputStream to read the contents of the file from. The user is responsible for closing the stream.

返回:
the contents of the file as stream, or an empty stream if empty
抛出:
java.io.IOException - in case of access errors (if the temporary store fails)

appendMessage

void appendMessage(java.lang.String message)
处理过程中,要在上传完毕后提示前端的信息,常用于查到病毒但杀毒成功的信息。

参数:
message - 提示信息。

setInputStream

void setInputStream(java.io.InputStream stream)
                    throws java.io.IOException
改变上传的文件,用于使用清除病毒以后的流替换原上传的文件流。

参数:
stream - 新的文件流。
抛出:
java.io.IOException

getMessages

java.util.Collection getMessages()
获取所有的前台提示信息。

返回:
提示信息集合。

saveAs

void saveAs(java.io.File file)
            throws java.io.IOException,
                   java.lang.IllegalStateException
Transfer the received file to the given destination file.

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 file
抛出:
java.io.IOException - in case of reading or writing errors
java.lang.IllegalStateException - if the file has already been moved in the filesystem and is not available anymore for another transfer