本文整理了Java中javax.mail.internet.MimeBodyPart.removeHeader()
方法的一些代码示例,展示了MimeBodyPart.removeHeader()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeBodyPart.removeHeader()
方法的具体详情如下:
包路径:javax.mail.internet.MimeBodyPart
类名称:MimeBodyPart
方法名:removeHeader
[英]Remove all headers with this name.
[中]删除所有具有此名称的标题。
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @param cid the Content-ID
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException for other failures
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @param cid the Content-ID
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException for other failures
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec
public void setDataHandler(DataHandler handler) throws MessagingException {
dh = handler;
// if we have a handler override, then we need to invalidate any content
// headers that define the types. This information will be derived from the
// data heander unless subsequently overridden.
removeHeader("Content-Type");
removeHeader("Content-Transfer-Encoding");
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec
public void setDataHandler(DataHandler handler) throws MessagingException {
dh = handler;
// if we have a handler override, then we need to invalidate any content
// headers that define the types. This information will be derived from the
// data heander unless subsequently overridden.
removeHeader("Content-Type");
removeHeader("Content-Transfer-Encoding");
}
代码示例来源:origin: javax.mail/javax.mail-api
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @param cid the Content-ID
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException for other failures
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: com.sun.mail/jakarta.mail
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @param cid the Content-ID
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException for other failures
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: javax.mail/com.springsource.javax.mail
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: jboss/jboss-javaee-specs
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @param cid the Content-ID
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException for other failures
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec
public void setContentLanguage(String[] languages) throws MessagingException {
if (languages == null) {
removeHeader("Content-Language");
} else if (languages.length == 1) {
setHeader("Content-Language", languages[0]);
} else {
StringBuffer buf = new StringBuffer(languages.length * 20);
buf.append(languages[0]);
for (int i = 1; i < languages.length; i++) {
buf.append(',').append(languages[i]);
}
setHeader("Content-Language", buf.toString());
}
}
代码示例来源:origin: com.sun.mail/mailapi
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @param cid the Content-ID
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException for other failures
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec
public void setContentLanguage(String[] languages) throws MessagingException {
if (languages == null) {
removeHeader("Content-Language");
} else if (languages.length == 1) {
setHeader("Content-Language", languages[0]);
} else {
StringBuffer buf = new StringBuffer(languages.length * 20);
buf.append(languages[0]);
for (int i = 1; i < languages.length; i++) {
buf.append(',').append(languages[i]);
}
setHeader("Content-Language", buf.toString());
}
}
代码示例来源:origin: org.glassfish.metro/webservices-extra
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @param cid the Content-ID
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException for other failures
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: com.sun.mail/android-mail
/**
* Set the "Content-ID" header field of this body part.
* If the <code>cid</code> parameter is null, any existing
* "Content-ID" is removed.
*
* @param cid the Content-ID
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this body part is
* obtained from a READ_ONLY folder.
* @exception MessagingException for other failures
* @since JavaMail 1.3
*/
public void setContentID(String cid) throws MessagingException {
if (cid == null)
removeHeader("Content-ID");
else
setHeader("Content-ID", cid);
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec
public void setDescription(String description, String charset) throws MessagingException {
if (description == null) {
removeHeader("Content-Description");
}
else {
try {
setHeader("Content-Description", MimeUtility.fold(21, MimeUtility.encodeText(description, charset, null)));
} catch (UnsupportedEncodingException e) {
throw new MessagingException(e.getMessage(), e);
}
}
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec
public void setDescription(String description, String charset) throws MessagingException {
if (description == null) {
removeHeader("Content-Description");
}
else {
try {
setHeader("Content-Description", ASCIIUtil.fold(21, MimeUtility.encodeText(description, charset, null)));
} catch (UnsupportedEncodingException e) {
throw new MessagingException(e.getMessage(), e);
}
}
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec
/**
* Set a new dispostion value for the "Content-Disposition" field.
* If the new value is null, the header is removed.
*
* @param disposition
* The new disposition value.
*
* @exception MessagingException
*/
public void setDisposition(String disposition) throws MessagingException {
if (disposition == null) {
removeHeader("Content-Disposition");
}
else {
// the disposition has parameters, which we'll attempt to preserve in any existing header.
String currentHeader = getSingleHeader("Content-Disposition");
if (currentHeader != null) {
ContentDisposition content = new ContentDisposition(currentHeader);
content.setDisposition(disposition);
setHeader("Content-Disposition", content.toString());
}
else {
// set using the raw string.
setHeader("Content-Disposition", disposition);
}
}
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec
/**
* Set a new dispostion value for the "Content-Disposition" field.
* If the new value is null, the header is removed.
*
* @param disposition
* The new disposition value.
*
* @exception MessagingException
*/
public void setDisposition(String disposition) throws MessagingException {
if (disposition == null) {
removeHeader("Content-Disposition");
}
else {
// the disposition has parameters, which we'll attempt to preserve in any existing header.
String currentHeader = getSingleHeader("Content-Disposition");
if (currentHeader != null) {
ContentDisposition content = new ContentDisposition(currentHeader);
content.setDisposition(disposition);
setHeader("Content-Disposition", content.toString());
}
else {
// set using the raw string.
setHeader("Content-Disposition", disposition);
}
}
}
代码示例来源:origin: gitblit/fathom
mimeBodyPart.removeHeader(entry.getKey());
} else {
mimeBodyPart.setHeader(entry.getKey(), entry.getValue());
代码示例来源:origin: com.gitblit.fathom/fathom-mailer
mimeBodyPart.removeHeader(entry.getKey());
} else {
mimeBodyPart.setHeader(entry.getKey(), entry.getValue());
内容来源于网络,如有侵权,请联系作者删除!