public class AttachmentDirectory extends Object implements Serializable
A directory that contains hierarchical information about the attachments of an email. Its purpose is to create an XML stream that can be embedded into the cover page of a converted email.
All streams — the whole attachments overview, file containers (e.g. zip files) and single
files — are all represented by a single instance of this class, but only real physical
files (that means all but the whole attachment overview) also contain the reference the
StreamDescriptor
that is associated with the file each AttachmentDirectory
object
represents.
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_KEY |
Constructor and Description |
---|
AttachmentDirectory()
Constructor for the email root
|
AttachmentDirectory(StreamDescriptor descriptor,
int pageIndex)
Constructor for a file or a file container (e.g.
|
Modifier and Type | Method and Description |
---|---|
void |
addHierarchy(Stack<StreamDescriptor> stack,
int pageIndex)
Add another hierarchy of "files containing files" into this
AttachmentDirectory here. |
String |
getFilename() |
int |
getPageIndex() |
StreamDescriptor |
getStreamDescriptor() |
List<AttachmentDirectory> |
getSubDirectories()
Contains an unmodifiable view of all files that are contained in the file that is represented
by this object here.
|
String |
getType()
The MIME type of the file represented by this object.
|
boolean |
isEmpty() |
public static String PROPERTY_KEY
public AttachmentDirectory()
public AttachmentDirectory(StreamDescriptor descriptor, int pageIndex)
descriptor
- The file's StreamDescriptor
pageIndex
- the index on which page this file is located (or -1
if counting
was not possible / required)public String getFilename()
public String getType()
public StreamDescriptor getStreamDescriptor()
StreamDescriptor
of the file represented by this object.public int getPageIndex()
-1
if attachment counting was not possible /
performed.public List<AttachmentDirectory> getSubDirectories()
public boolean isEmpty()
public void addHierarchy(Stack<StreamDescriptor> stack, int pageIndex)
AttachmentDirectory
here.
The topmost element from the stack must also be the topmost element in the hierarchy.
All sub-hierarchies (-> subfolders) will be generated automatically.
If the stack contains the StreamDescriptor
that is associated with this object, all
elements above in the stack will be ignored.stack
- contains a path to the file to insert in the attachment hierarchypageIndex
- the index of the file to insert. Value -1
indicates that page counting
either not required or not possibleCopyright © 2017 levigo holding gmbh. All rights reserved.