当前页面:
在线文档首页 >
JBOSS Portal 2.4 API 英文版文档
TempFileBinding - JBOSS Portal 2.4 API 英文版文档
org.jboss.portlet.forums.helper
Class TempFileBinding
java.lang.Object
org.jboss.portlet.forums.helper.FileBinding
org.jboss.portlet.forums.helper.TempFileBinding
- public class TempFileBinding
- extends FileBinding
Provides binding to temp file stored to disk.
Constructor Summary |
TempFileBinding(java.lang.String contentType,
byte[] content,
java.lang.String name,
java.lang.String id)
Creates TempFileBinding. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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