|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.rad.io.RemoteFileHandle
public class RemoteFileHandle
The RemoteFileHandle
handles data that is stored in the ObjectCache.
Supported Objects are java.io.File, java.net.URL, javax.rad.io.IFileHandle and byte[].
The Bean standard guarantees with the properties "fileName" and "objectCacheKey" that it
can be transported with a connection. The Creator of the ObjectCacheHandle has to guarantee
that the data is available under the given key.
For compatibility reasons is the ObjectCacheHandle also serializable.
Constructor Summary | |
---|---|
RemoteFileHandle()
Constructs a new FileHandle. |
|
RemoteFileHandle(java.io.File pContent)
Constructs a new FileHandle with the given file as content. |
|
RemoteFileHandle(java.lang.String pFileName)
Constructs a new FileHandle. |
|
RemoteFileHandle(java.lang.String pFileName,
java.io.InputStream pContent)
Constructs a new FileHandle. |
|
RemoteFileHandle(java.lang.String pFileName,
java.lang.Object pObjectCacheKey)
Constructs a new FileHandle. |
|
RemoteFileHandle(java.lang.String pFileName,
java.lang.Object pObjectCacheKey,
java.io.InputStream pContent)
Constructs a new FileHandle. |
|
RemoteFileHandle(java.lang.String pFileName,
java.lang.Object pObjectCacheKey,
java.net.URL pContent)
Constructs a new FileHandle. |
|
RemoteFileHandle(java.lang.String pFileName,
java.net.URL pContent)
Constructs a new FileHandle. |
Method Summary | |
---|---|
static java.lang.Object |
createObjectCacheKey()
Gets the access key for the object. |
protected void |
finalize()
|
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.lang.Object |
getObjectCacheKey()
Gets the ObjectCache key. |
java.io.OutputStream |
getOutputStream()
Resets the content to zero, and gets an OutputStresm to write the content. |
long |
getTimeout()
Gets the ObjectCache key. |
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 a InputStream. |
void |
setContent(java.net.URL pContent)
Sets a new content with a URL. |
void |
setFileName(java.lang.String pFileName)
Sets the file name of this file handle. |
void |
setObjectCacheKey(java.lang.Object pObjectCacheKey)
Sets the ObjectCache key. |
void |
setTimeout(long pTimeout)
Sets the ObjectCache key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RemoteFileHandle()
public RemoteFileHandle(java.lang.String pFileName)
pFileName
- the file name.public RemoteFileHandle(java.lang.String pFileName, java.lang.Object pObjectCacheKey)
pFileName
- the filename.pObjectCacheKey
- the ObjectCache key.public RemoteFileHandle(java.lang.String pFileName, java.net.URL pContent)
pFileName
- the filename.pContent
- the content.public RemoteFileHandle(java.lang.String pFileName, java.lang.Object pObjectCacheKey, java.net.URL pContent)
pFileName
- the filename.pObjectCacheKey
- the ObjectCache key.pContent
- the content.public RemoteFileHandle(java.lang.String pFileName, java.io.InputStream pContent) throws java.io.IOException
pFileName
- the filename.pContent
- the content.
java.io.IOException
- if an IOException occurs.public RemoteFileHandle(java.lang.String pFileName, java.lang.Object pObjectCacheKey, java.io.InputStream pContent) throws java.io.IOException
pFileName
- the filename.pObjectCacheKey
- the ObjectCache key.pContent
- the content.
java.io.IOException
- if an IOException occurs.public RemoteFileHandle(java.io.File pContent)
pContent
- the content.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 static java.lang.Object createObjectCacheKey()
public void setFileName(java.lang.String pFileName)
pFileName
- the file name of this file handle.public java.lang.Object getObjectCacheKey()
public void setObjectCacheKey(java.lang.Object pObjectCacheKey)
pObjectCacheKey
- the ObjectCache key.public long getTimeout()
public void setTimeout(long pTimeout)
pTimeout
- the ObjectCache key.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
pContent
- the new content.
java.io.IOException
- if an IOException occurs.public void setContent(java.io.File pContent)
pContent
- the new content.public void setContent(java.net.URL pContent)
pContent
- the new content.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |