Package com.helger.phase4.attachment
Interface IAS4Attachment
- All Known Implementing Classes:
WSS4JAttachment
public interface IAS4Attachment
Read-only interface for an attachment.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault CharsetgetCharsetOrDefault(Charset aDefault) Get the specified character set or the provided default value.com.helger.mail.cte.EContentTransferEncodinggetId()com.helger.commons.io.IHasInputStreamThis is primarily an internal method.Get the source stream of the attachment using the default resource helper.getSourceStream(AS4ResourceHelper aResourceHelper) Get the source stream of the attachment using the provided resource helper, to automatically close the stream at the end of the message.booleandefault booleandefault boolean
-
Method Details
-
getId
String getId()- Returns:
- The attachment Content ID. Must NOT contain any "cid" prefix.
-
getMimeType
String getMimeType()- Returns:
- The MIME type in a string representation. If the attachment was
compressed and the
MimeTypepart property was set it can be queried viagetUncompressedMimeType() - See Also:
-
getUncompressedMimeType
- Returns:
- The MIME type of the uncompressed attachment. May be
null. This is only set, if compression was active. Otherwise usegetMimeType(). - See Also:
-
getSourceStream
Get the source stream of the attachment using the default resource helper. The streams retrieved by this method are automatically closed when the respective resource helper goes out of scope.- Returns:
- A non-
nullInputStream on the source.
-
getSourceStream
Get the source stream of the attachment using the provided resource helper, to automatically close the stream at the end of the message. This can be helpful, if the source helper is already out of scope.- Parameters:
aResourceHelper- The resource helper to use. May not benull.- Returns:
- A non-
nullInputStream on the source.
-
getInputStreamProvider
This is primarily an internal method. If you use it, you need to make sure to close the streams yourself if you open them.- Returns:
- The internal input stream provider. May be
null.
-
isRepeatable
default boolean isRepeatable()- Returns:
trueif the input stream backing this attachment can be read multiple times,falseif not.
-
getContentTransferEncoding
- Returns:
- The content transfer encoding to be used. Required for MIME
multipart handling only. May not be
null.
-
getCompressionMode
- Returns:
- The compression mode to use or
nullif the attachment is not compressed.
-
hasCompressionMode
default boolean hasCompressionMode()- Returns:
trueif a compression mode is set,falseif not.
-
getCharset
- Returns:
- The defined character set, falling back to ISO-8859-1 if none is defined.
-
getCharsetOrDefault
Get the specified character set or the provided default value.- Parameters:
aDefault- The default value to be returned, if no character set is provided. May benull.- Returns:
- Only
nullif no character set is defined and the provided default value isnull.
-
hasCharset
boolean hasCharset()- Returns:
trueif a character set is defined,falseif not.
-
customPartProperties
@Nonnull @ReturnsMutableObject com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> customPartProperties()- Returns:
- A non-
nullbut maybe empty map of custom PartInfo/PartProperties for the UserMessage. - Since:
- 0.12.0
-