站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.4 API 英文版文档

TempFileBinding - JBOSS Portal 2.4 API 英文版文档


org.jboss.portlet.forums.helper
Class TempFileBinding

java.lang.Object
  extended byorg.jboss.portlet.forums.helper.FileBinding
      extended byorg.jboss.portlet.forums.helper.TempFileBinding

public class TempFileBinding
extends FileBinding

Provides binding to temp file stored to disk.


Field Summary
 
Fields inherited from class org.jboss.portlet.forums.helper.FileBinding
comment, fileId, fileName
 
Constructor Summary
TempFileBinding(java.lang.String contentType, byte[] content, java.lang.String name, java.lang.String id)
          Creates TempFileBinding.
 
Method Summary
 void delete()
          Deletes stored on disk file.
static byte[] getBytesFromFile(java.io.File file)
           
 java.lang.String getContentType()
           
 java.lang.String getFilePath()
           
 Attachment produceAttachment()
          produces Attachment object form stored on disk file
 UploadedFile produceUploadedFile()
          produces UploadedFile from stored on disk file.
 void setContentType(java.lang.String contentType)
           
 void setFilePath(java.lang.String filePath)
           
 
Methods inherited from class org.jboss.portlet.forums.helper.FileBinding
getComment, getFileId, getFileName, setComment, setFileId, setFileName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TempFileBinding

public TempFileBinding(java.lang.String contentType,
                       byte[] content,
                       java.lang.String name,
                       java.lang.String id)
                throws java.io.IOException
Creates TempFileBinding. Content will be strored in temporary file using File.createTempFile

Parameters:
contentType -
content -
name -
id -
Throws:
java.io.IOException
Method Detail

delete

public void delete()
Deletes stored on disk file.


getFilePath

public java.lang.String getFilePath()

setFilePath

public void setFilePath(java.lang.String filePath)

getContentType

public java.lang.String getContentType()

setContentType

public void setContentType(java.lang.String contentType)

produceUploadedFile

public UploadedFile produceUploadedFile()
produces UploadedFile from stored on disk file.

Returns:

produceAttachment

public Attachment produceAttachment()
produces Attachment object form stored on disk file

Returns:

getBytesFromFile

public static byte[] getBytesFromFile(java.io.File file)
                               throws java.io.IOException
Throws:
java.io.IOException