Class RTFOffsetInserter
- java.lang.Object
-
- com.levigo.jadice.server.mail.worker.internal.util.RTFOffsetInserter
-
public class RTFOffsetInserter extends Object
This class offers the possibility to insert a start offset into rtf contents meaning that the rendered content starts beneath this inital offset. This class has been created for converting rtf mail bodies. The initial offset is needed such that the mail body starts right beneath the attachment listing.
-
-
Field Summary
Fields Modifier and Type Field Description static int[]
NEEDLE
The int representation of the needle string.static String
NEEDLE_STRING
The needle stream in the rtf document.static String
OFFSET_PREFIX
Offset marker prefix.static String
OFFSET_SUFFIX
Offset marker suffix.
-
Constructor Summary
Constructors Constructor Description RTFOffsetInserter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
getBOMBytes(org.apache.commons.io.input.BOMInputStream bomInputStream)
static com.levigo.jadice.document.io.SeekableInputStream
insertOffsetIntoRTFStream(com.levigo.jadice.document.io.SeekableInputStream sis, String encoding, double pageViewHeight, double pageViewHeightOffset)
Inserts the rtf body offset such that the body appears below the email metadata.
-
-
-
Field Detail
-
OFFSET_PREFIX
public static final String OFFSET_PREFIX
Offset marker prefix.- See Also:
- Constant Field Values
-
OFFSET_SUFFIX
public static final String OFFSET_SUFFIX
Offset marker suffix.- See Also:
- Constant Field Values
-
NEEDLE_STRING
public static final String NEEDLE_STRING
The needle stream in the rtf document. The rtf offset marker will be inserted in front of this marker.- See Also:
- Constant Field Values
-
NEEDLE
public static final int[] NEEDLE
The int representation of the needle string.
-
-
Method Detail
-
insertOffsetIntoRTFStream
public static com.levigo.jadice.document.io.SeekableInputStream insertOffsetIntoRTFStream(com.levigo.jadice.document.io.SeekableInputStream sis, String encoding, double pageViewHeight, double pageViewHeightOffset) throws IOException
Inserts the rtf body offset such that the body appears below the email metadata.- Parameters:
sis
- the input stream.encoding
- the encoding that has been determined for the input stream.pageViewHeight
- this parameter is ignored.pageViewHeightOffset
- the offset.- Returns:
- the rtf body string with the proper top offset such that it fits to the previously generated mail metadata.
- Throws:
IOException
- If an I/O error occurs
-
getBOMBytes
public static byte[] getBOMBytes(org.apache.commons.io.input.BOMInputStream bomInputStream) throws IOException
- Throws:
IOException
-
-