|
||||||||||
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
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.
Field Summary | |
---|---|
static String |
OBJECT_CACHE_KEY
Placeholder for the ObjectCache key. |
Constructor Summary | |
---|---|
RemoteFileHandle()
Constructs a new FileHandle. |
|
RemoteFileHandle(File pContent)
Constructs a new FileHandle with the given file as content. |
|
RemoteFileHandle(String pFileName)
Constructs a new FileHandle. |
|
RemoteFileHandle(String pFileName,
InputStream pContent)
Constructs a new FileHandle. |
|
RemoteFileHandle(String pFileName,
Object pObjectCacheKey)
Constructs a new FileHandle. |
|
RemoteFileHandle(String pFileName,
Object pObjectCacheKey,
InputStream pContent)
Constructs a new FileHandle. |
|
RemoteFileHandle(String pFileName,
Object pObjectCacheKey,
URL pContent)
Constructs a new FileHandle. |
|
RemoteFileHandle(String pFileName,
URL pContent)
Constructs a new FileHandle. |
Method Summary | |
---|---|
static Object |
createObjectCacheKey()
Gets the access key for the object. |
protected void |
finalize()
|
String |
getDownloadURL()
Gets the download URL with filled in key. |
static String |
getDownloadURL(Object pObjectCacheKey)
Creates the download URL with filled in key. |
static String |
getDownloadURLSpec()
Gets the download URL, that specifies where to get the content from server. |
String |
getFileName()
Gets the file name of this file handle. |
InputStream |
getInputStream()
Gets the InputStream of this file handle. |
long |
getLength()
Gets the length of the InputStream in bytes |
Object |
getObjectCacheKey()
Gets the ObjectCache key. |
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(File pContent)
Sets a new content with a File. |
void |
setContent(InputStream pContent)
Sets a new content with a InputStream. |
void |
setContent(URL pContent)
Sets a new content with a URL. |
static void |
setDownloadURLSpec(String pDownloadURLSpec)
Sets the download URL, that specifies where to get the content from server. |
void |
setFileName(String pFileName)
Sets the file name of this file handle. |
void |
setObjectCacheKey(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 |
Field Detail |
---|
public static final String OBJECT_CACHE_KEY
Constructor Detail |
---|
public RemoteFileHandle()
public RemoteFileHandle(String pFileName)
pFileName
- the file name.public RemoteFileHandle(String pFileName, Object pObjectCacheKey)
pFileName
- the filename.pObjectCacheKey
- the ObjectCache key.public RemoteFileHandle(String pFileName, URL pContent)
pFileName
- the filename.pContent
- the content.public RemoteFileHandle(String pFileName, Object pObjectCacheKey, URL pContent)
pFileName
- the filename.pObjectCacheKey
- the ObjectCache key.pContent
- the content.public RemoteFileHandle(String pFileName, InputStream pContent) throws IOException
pFileName
- the filename.pContent
- the content.
IOException
- if an IOException occurs.public RemoteFileHandle(String pFileName, Object pObjectCacheKey, InputStream pContent) throws IOException
pFileName
- the filename.pObjectCacheKey
- the ObjectCache key.pContent
- the content.
IOException
- if an IOException occurs.public RemoteFileHandle(File pContent)
pContent
- the content.Method Detail |
---|
public String getFileName()
getFileName
in interface IFileHandle
public InputStream getInputStream() throws IOException
getInputStream
in interface IFileHandle
IOException
- if an exception occurs.public long getLength() throws IOException
getLength
in interface IFileHandle
IOException
- if an exception occurs.public static String getDownloadURLSpec()
public static void setDownloadURLSpec(String pDownloadURLSpec)
pDownloadURLSpec
- the download URL, that specifies where to get the content from server.public static String getDownloadURL(Object pObjectCacheKey) throws MalformedURLException
pObjectCacheKey
- the ObjectCache key.
MalformedURLException
- if the download url is a malformed.public String getDownloadURL() throws MalformedURLException
MalformedURLException
- if the download url is a malformed.public static Object createObjectCacheKey()
public void setFileName(String pFileName)
pFileName
- the file name of this file handle.public Object getObjectCacheKey()
public void setObjectCacheKey(Object pObjectCacheKey)
pObjectCacheKey
- the ObjectCache key.public long getTimeout()
public void setTimeout(long pTimeout)
pTimeout
- the ObjectCache key.public OutputStream getOutputStream() throws IOException
IOException
- if an IOException occurs.public void setContent(byte[] pContent) throws IOException
pContent
- the new content.
IOException
- if an IOException occurs.public void setContent(InputStream pContent) throws IOException
pContent
- the new content.
IOException
- if an IOException occurs.public void setContent(File pContent)
pContent
- the new content.public void setContent(URL pContent)
pContent
- the new content.protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |