public class AS2ClientRequest extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CONTENT_TYPE |
| Constructor and Description |
|---|
AS2ClientRequest(String sSubject) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyDataOntoMimeBodyPart(javax.mail.internet.MimeBodyPart aPart) |
com.helger.mail.cte.EContentTransferEncoding |
getContentTransferEncoding() |
String |
getContentType() |
String |
getSubject() |
AS2ClientRequest |
setContentDescription(String sDescription)
Set the optional Content-Description header to be used.
|
AS2ClientRequest |
setContentTransferEncoding(com.helger.mail.cte.EContentTransferEncoding eCTE)
Set the optional Content-Transfer-Encoding to be used.
|
AS2ClientRequest |
setContentType(String sContentType)
Set the content type to be used.
|
AS2ClientRequest |
setData(byte[] aData) |
AS2ClientRequest |
setData(DataHandler aDataHandler) |
AS2ClientRequest |
setData(File aFile)
Deprecated.
|
AS2ClientRequest |
setData(File aFile,
Charset aCharset)
Set the content of the
File as a payload. |
AS2ClientRequest |
setData(InputStream aIS)
Set the content of the
InputStream as a payload. |
AS2ClientRequest |
setData(InputStream aIS,
Charset aCharset)
Set the content of the
InputStream as a payload. |
AS2ClientRequest |
setData(String sText,
Charset aCharset) |
AS2ClientRequest |
setFilename(String sFilename)
Set the filename to be used to name the content.
|
public static final String DEFAULT_CONTENT_TYPE
@Nonnull @Nonempty public String getSubject()
null nor empty.@Nonnull public AS2ClientRequest setContentType(@Nonnull @Nonempty String sContentType)
sContentType - The content type. May neither be null nor empty.@Nonnull @Nonempty public String getContentType()
DEFAULT_CONTENT_TYPE.@Nonnull @Deprecated public AS2ClientRequest setData(@Nonnull File aFile)
File as a payload. No charset is applied and
therefore no content type starting with "text/" may be used. The name of
the file is used as the payload file name.aFile - File to read the content from. Never null.setData(File, Charset)@Nonnull public AS2ClientRequest setData(@Nonnull File aFile, @Nullable Charset aCharset)
File as a payload. If no charset is applied
( null) no content type starting with "text/" may be used. The
name of the file is used as the payload file name.aFile - File to read the content from. Never null.aCharset - Charset to use. If it is null the content is set as a
byte array, if not null the content is set as a String.@Nonnull public AS2ClientRequest setData(@Nonnull @WillClose InputStream aIS)
InputStream as a payload. No charset is
applied and therefore no content type starting with "text/" may be used.aIS - InputStream to read the content from. Never
null.@Nonnull public AS2ClientRequest setData(@Nonnull @WillClose InputStream aIS, @Nullable Charset aCharset)
InputStream as a payload. No charset is
applied and therefore no content type starting with "text/" may be used.aIS - InputStream to read the content from. Never
null.aCharset - Charset to use. If it is null the content is set as a
byte array, if not null the content is set as a String.@Nonnull public AS2ClientRequest setData(@Nonnull byte[] aData)
@Nonnull public AS2ClientRequest setData(@Nonnull DataHandler aDataHandler)
@Nonnull public AS2ClientRequest setFilename(@Nullable String sFilename)
Content-Disposition: attachment; filename=... header to the
MIME partsFilename - Filename to use. May be null to indicate none (also the
default)@Nonnull public AS2ClientRequest setContentTransferEncoding(@Nullable com.helger.mail.cte.EContentTransferEncoding eCTE)
eCTE - CTE to be used. May be null in which case the default
CTE is used.@Nullable public com.helger.mail.cte.EContentTransferEncoding getContentTransferEncoding()
null.@Nonnull public AS2ClientRequest setContentDescription(@Nullable String sDescription)
sDescription - Content description to be used. May be null.public void applyDataOntoMimeBodyPart(@Nonnull javax.mail.internet.MimeBodyPart aPart) throws javax.mail.MessagingException
javax.mail.MessagingExceptionCopyright © 2013–2019 Philip Helger. All rights reserved.