javax.mail.internet.MimeMessage.setDescription()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(12.5k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中javax.mail.internet.MimeMessage.setDescription()方法的一些代码示例,展示了MimeMessage.setDescription()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeMessage.setDescription()方法的具体详情如下:
包路径:javax.mail.internet.MimeMessage
类名称:MimeMessage
方法名:setDescription

MimeMessage.setDescription介绍

[英]Set the "Content-Description" header field for this Message. If the description parameter is null, then any existing "Content-Description" fields are removed.

If the description contains non US-ASCII characters, it will be encoded using the platform's default charset. If the description contains only US-ASCII characters, no encoding is done and it is used as-is.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.
[中]设置此邮件的“内容描述”标题字段。如果描述参数为null,则删除所有现有的“内容描述”字段。
如果描述包含非US-ASCII字符,则将使用平台的默认字符集对其进行编码。如果描述仅包含US-ASCII字符,则不进行编码,而是按原样使用。
请注意,如果字符集编码过程失败,将抛出MessaginException,并且在MessaginException内的嵌套异常链中包含UnsupportedEncodingException。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
@Override
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: com.sun.mail/javax.mail

multipart.addBodyPart(body);
msg.setContent(multipart);
msg.setDescription(msgDesc);
setAcceptLang(msg);
msg.saveChanges();

代码示例来源:origin: camunda/camunda-bpm-platform

multipart.addBodyPart(body);
msg.setContent(multipart);
msg.setDescription(msgDesc);
setAcceptLang(msg);
msg.saveChanges();

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec

public void setDescription(String description) throws MessagingException {
  setDescription(description, null);
}

代码示例来源:origin: org.eclipse.scout.rt/org.eclipse.scout.commons

@Override
public void setDescription(String description) throws MessagingException {
 super.setDescription(description, m_charset);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec

public void setDescription(String description) throws MessagingException {
  setDescription(description, null);
}

代码示例来源:origin: camunda/camunda-bpm-platform

msg.setDescription(descriptionFrom(comparator, pushLevel, pushFilter));

代码示例来源:origin: com.sun.mail/javax.mail

final MimePart body;
if (parts.length == 0) {
  msg.setDescription(descriptionFrom(
      getFormatter(), getFilter(), subjectFormatter));
  body = msg;
} else {
  msg.setDescription(descriptionFrom(
      comparator, pushLevel, pushFilter));
  body = createBodyPart();

代码示例来源:origin: javax.mail/javax.mail-api

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
@Override
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: com.sun.mail/mailapi

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
@Override
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: com.sun.mail/jakarta.mail

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
@Override
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException. An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: javax.mail/com.springsource.javax.mail

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException. An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: org.glassfish.metro/webservices-extra

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
@Override
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: com.sun.mail/android-mail

/**
 * Set the "Content-Description" header field for this Message.
 * If the description parameter is <code>null</code>, then any 
 * existing "Content-Description" fields are removed. <p>
 *
 * If the description contains non US-ASCII characters, it will 
 * be encoded using the platform's default charset. If the 
 * description contains only US-ASCII characters, no encoding 
 * is done and it is used as-is. <p>
 *
 * Note that if the charset encoding process fails, a
 * MessagingException is thrown, and an UnsupportedEncodingException
 * is included in the chain of nested exceptions within the
 * MessagingException.
 * 
 * @param description content-description
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException An
 *             UnsupportedEncodingException may be included
 *            in the exception chain if the charset
 *            conversion fails.
 */
@Override
public void setDescription(String description) throws MessagingException {
setDescription(description, null);
}

代码示例来源:origin: org.apache.james/james-server-core-library

/**
 * @see javax.mail.Part#setDescription(java.lang.String)
 */
public void setDescription(String description) throws MessagingException {
  getWrappedMessageForWriting().setDescription(description);
}

代码示例来源:origin: org.apache.james/james-server-core-library

/**
 * @see javax.mail.internet.MimeMessage#setDescription(java.lang.String, java.lang.String)
 */
public void setDescription(String description, String charset)
    throws MessagingException {
  getWrappedMessageForWriting().setDescription(description, charset);
}

代码示例来源:origin: com.sun.mail/android-mail

multipart.addBodyPart(body);
msg.setContent(multipart);
msg.setDescription(msgDesc);
setAcceptLang(msg);
msg.saveChanges();

代码示例来源:origin: jboss/jboss-javaee-specs

multipart.addBodyPart(body);
msg.setContent(multipart);
msg.setDescription(msgDesc);
setAcceptLang(msg);
msg.saveChanges();

相关文章

MimeMessage类方法