|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.rad.io.FileHandle
public class FileHandle
FileHandle handles data in memory or in the file system. The Bean standard guarantees with the properties "fileName" and "gZIPContent" that it can be transported with a connection. For compatibility reasons is the FileHandle also Serializable.
Constructor Summary | |
---|---|
FileHandle()
Constructs a new FileHandle. |
|
FileHandle(java.io.File pContent)
Constructs a new FileHandle. |
|
FileHandle(java.lang.String pAbsolutePath)
Constructs a new FileHandle. |
|
FileHandle(java.lang.String pFileName,
byte[] pContent)
Constructs a new file handle with the content from a byte[] . |
|
FileHandle(java.lang.String pFileName,
java.io.InputStream pContent)
Constructs a file handle with the content form an InputStream . |
Method Summary | |
---|---|
protected void |
finalize()
|
java.lang.Object |
getContentDefinition()
Gets the content (definition). |
java.io.File |
getFile()
Gets the file that was set as content. |
java.lang.String |
getFileName()
Gets the file name of this file handle. |
java.io.InputStream |
getInputStream()
Gets the InputStream of this file handle. |
long |
getLength()
Gets the length of the InputStream in bytes |
java.io.OutputStream |
getOutputStream()
Resets the content to zero, and gets an OutputStresm to write the content. |
void |
setContent(byte[] pContent)
Sets a new content with a byte array. |
void |
setContent(java.io.File pContent)
Sets a new content with a File. |
void |
setContent(java.io.InputStream pContent)
Sets a new content with an InputStream . |
void |
setContentDefinition(java.lang.Object pDefinition)
Sets the content (definition). |
void |
setFileName(java.lang.String pFileName)
Sets the file name of this file handle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileHandle()
public FileHandle(java.lang.String pAbsolutePath)
pAbsolutePath
- the absolute path of the file.public FileHandle(java.lang.String pFileName, byte[] pContent) throws java.io.IOException
byte[]
.
pFileName
- the file name.pContent
- the content.
java.io.IOException
- if an IOException occurs.public FileHandle(java.lang.String pFileName, java.io.InputStream pContent) throws java.io.IOException
InputStream
.
pFileName
- the file name.pContent
- the content.
java.io.IOException
- if an IOException occurs.public FileHandle(java.io.File pContent) throws java.io.IOException
pContent
- the content.
java.io.IOException
- if an IOException occurs.Method Detail |
---|
public java.lang.String getFileName()
getFileName
in interface IFileHandle
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface IFileHandle
java.io.IOException
- if an exception occurs.public long getLength() throws java.io.IOException
getLength
in interface IFileHandle
java.io.IOException
- if an exception occurs.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void setFileName(java.lang.String pFileName)
pFileName
- the file name of this file handle.public java.io.File getFile()
public java.lang.Object getContentDefinition() throws java.io.IOException
IFileHandle
or
an GZIP compressed byte[]
. It depends on the current state, whether the file was used only
locally or sent to a remote server. This method is primarily for serialization support.
java.io.IOException
- if accessing content failedpublic void setContentDefinition(java.lang.Object pDefinition) throws java.io.IOException
pDefinition
- an IFileHandle
or a GZIP compressed byte[]
.
java.io.IOException
- if accessing content failedgetContentDefinition()
public java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
- if an IOException occurs.public void setContent(byte[] pContent) throws java.io.IOException
pContent
- the new content.
java.io.IOException
- if an IOException occurs.public void setContent(java.io.InputStream pContent) throws java.io.IOException
InputStream
.
pContent
- the new content.
java.io.IOException
- if an IOException occurs.public void setContent(java.io.File pContent)
pContent
- the new content.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |