public interface IncomingFileAttachment extends IncomingAttachment
FILE_ATTACHMENT, MEMORY_ATTACHMENT, OUTPUTSTREAM_ATTACHMENT, STREAM_ATTACHMENT| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAbsoluteFilename()
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.
|
getBytes, getInputStream, isAvailablecanDetermineSize, dispose, getContentId, getContentType, getType, sizejava.lang.String getAbsoluteFilename()
throws AttachmentException
type Attachment.FILE_ATTACHMENT. For any other types, it will
throw an AttachmentException.AttachmentExceptionvoid 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 toAttachmentException - if attachment processing is not supported within the current runtime or obtaining the attachment failed
for any reasonjava.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 totrue, if the file was moved/renamed successfully, false otherwiseAttachmentException - 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)