public final class AttachmentDirectoryFactory extends Object
AttachmentDirectory
from a bunch of email attachments.
If these attachments are PDFs (or converted to PDF) page counting will be performed in order to
generate a proper TOC.Modifier and Type | Field and Description |
---|---|
static String |
COVER_FOR
Add another
StreamDescriptor with this key in the given
StreamDescriptor.getContext() s, so that that one will be taken as information to appear
in the resulting AttachmentDirectory . |
Modifier and Type | Method and Description |
---|---|
protected static int |
countPages(com.levigo.jadice.document.io.SeekableInputStream documentStream,
WorkerController<?> controller) |
protected static int |
createAttachment(StreamDescriptor sd,
StreamDescriptor rootDescriptor,
int nmbPages,
int pageOffset,
AttachmentDirectory rootDirectory)
Insert a
StreamDescriptor into the given attachment directory that represents the root
of the mail |
static AttachmentDirectory |
createAttachmentDirectory(StreamDescriptor rootDescriptor,
List<Stream> streams,
WorkerController<?> controller)
Create an
AttachmentDirectory that characterizes the given attachments. |
protected static BundledStream |
createStream(com.levigo.jadice.document.io.SeekableInputStream sis,
StreamDescriptor sd) |
static void |
exportToXML(XMLStreamWriter xsw,
AttachmentDirectory dir,
int pageIndexOffset) |
protected static StreamDescriptor |
getAttachmentDescriptor(StreamDescriptor sd)
Find the
StreamDescriptor that contains the attachment information for the given Stream
(identified by the given StreamDescriptor ). |
protected static byte[] |
toByteArray(InputStream stream) |
public static final String COVER_FOR
StreamDescriptor
with this key in the given
StreamDescriptor.getContext()
s, so that that one will be taken as information to appear
in the resulting AttachmentDirectory
.public static AttachmentDirectory createAttachmentDirectory(StreamDescriptor rootDescriptor, List<Stream> streams, WorkerController<?> controller) throws Throwable
AttachmentDirectory
that characterizes the given attachments.streams
- The pre-converted attachments as PDF. If the attachment has another MIME type,
page counting will be disabledAttachmentDirectory
that shows how the given attachments are placed within
the email that contains themThrowable
protected static int createAttachment(StreamDescriptor sd, StreamDescriptor rootDescriptor, int nmbPages, int pageOffset, AttachmentDirectory rootDirectory) throws Throwable
StreamDescriptor
into the given attachment directory that represents the root
of the mailsd
- The Descriptor to insertrootDescriptor
- TODOnmbPages
- how many pages the PDF / TIFF associated with the descriptor haspageOffset
- the number of pages that were handled beforerootDirectory
- the directory that contains all of the attachments of the mailAttachmentDirectory
Throwable
protected static StreamDescriptor getAttachmentDescriptor(StreamDescriptor sd)
StreamDescriptor
that contains the attachment information for the given Stream
(identified by the given StreamDescriptor
).sd
- StreamDescriptor
protected static byte[] toByteArray(InputStream stream) throws IOException
IOException
protected static BundledStream createStream(com.levigo.jadice.document.io.SeekableInputStream sis, StreamDescriptor sd) throws IOException
IOException
protected static int countPages(com.levigo.jadice.document.io.SeekableInputStream documentStream, WorkerController<?> controller) throws IOException
IOException
public static void exportToXML(XMLStreamWriter xsw, AttachmentDirectory dir, int pageIndexOffset) throws XMLStreamException
XMLStreamException
Copyright © 2017 levigo holding gmbh. All rights reserved.