|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IncomingFileAttachment
Field Summary |
---|
Fields inherited from interface org.ws4d.java.attachment.Attachment |
---|
FILE_ATTACHMENT, MEMORY_ATTACHMENT, OUTPUTSTREAM_ATTACHMENT, STREAM_ATTACHMENT |
Method Summary | |
---|---|
java.lang.String |
getFilePath()
Returns the path to the file encapsulated by this attachment. |
boolean |
isLocal()
Returns true , if this attachment was created locally. |
boolean |
move(java.lang.String newFilePath)
This method moves the file containing the attachment's raw data to the given target file path (e.g. |
void |
save(java.lang.String targetFilePath)
Copies the attachment's raw data to the target file path (e.g. |
Methods inherited from interface org.ws4d.java.attachment.IncomingAttachment |
---|
getBytes, getInputStream, isAvailable, size |
Methods inherited from interface org.ws4d.java.attachment.Attachment |
---|
dispose, getContentId, getContentType, getTransferEncoding, getType, serialize |
Method Detail |
---|
java.lang.String getFilePath() throws AttachmentException
type
Attachment.FILE_ATTACHMENT
. For any other types, it will throw an
AttachmentException
.
AttachmentException
void save(java.lang.String targetFilePath) throws AttachmentException, java.io.IOException
type
Attachment.FILE_ATTACHMENT
. In any other cases it
will throw an AttachmentException
.
targetFilePath
- the new path within the local file system to store
the file to
AttachmentException
- if attachment processing is not supported
within the current runtime or obtaining the attachment failed
for any reason
java.io.IOException
- in case writing to the local file system failed for
any reasonboolean move(java.lang.String newFilePath) throws AttachmentException
type
Attachment.FILE_ATTACHMENT
. In
any other cases it will throw an AttachmentException
.
newFilePath
- the new path within the local file system to move the
file to
true
, if the file was moved/renamed successfully,
false
otherwise
AttachmentException
- if attachment processing is not supported
within the current runtime or obtaining the attachment failed
for any reasonboolean isLocal()
true
, if this attachment was created locally. This
is synonymous to the sender/originator of this attachment instance
residing within the same Java virtual machine as its receiver.
This method is especially important for attachments of type
Attachment.FILE_ATTACHMENT
, as - if it returns true
-
this denotes that the file
the attachment points
to is the original one. That is, when attempting to move(String)
a file attachment, this allows to distinguish whether the original file
would be moved to a new location or whether simply the attachment file
will be moved out of the local attachment store (used for caching
incoming attachments) to a place outside of it.
true
only if this attachment was originally created
locally (within the same JVM)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |