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

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

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

MimeBodyPart.getHeader介绍

[英]Get all the headers for this header_name. Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.
[中]获取此标题名称的所有标题。请注意,如果某些标头包含非US-ASCII字符,则可以按照RFC 2047对其进行编码,并应对其进行解码。

代码示例

代码示例来源:origin: voldemort/voldemort

for(int i = 0; i < mp.getCount(); i++) {
  MimeBodyPart part = (MimeBodyPart) mp.getBodyPart(i);
  String serializedVC = part.getHeader(RestMessageHeaders.X_VOLD_VECTOR_CLOCK)[0];
  int contentLength = Integer.parseInt(part.getHeader(RestMessageHeaders.CONTENT_LENGTH)[0]);

代码示例来源:origin: voldemort/voldemort

String contentLocation = part.getHeader("Content-Location")[0];
String base64Key = contentLocation.split("/")[2];
ByteArray key = new ByteArray(RestUtils.decodeVoldemortKey(base64Key));
  String serializedVC = valuePart.getHeader(RestMessageHeaders.X_VOLD_VECTOR_CLOCK)[0];
  int contentLength = Integer.parseInt(valuePart.getHeader(RestMessageHeaders.CONTENT_LENGTH)[0]);

代码示例来源:origin: voldemort/voldemort

VectorClock vc = RestUtils.deserializeVectorClock(part.getHeader(RestMessageHeaders.X_VOLD_VECTOR_CLOCK)[0]);
int contentLength = Integer.parseInt(part.getHeader(RestMessageHeaders.CONTENT_LENGTH)[0]);
byte[] bodyPartBytes = new byte[contentLength];

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

/**
 * Returns the value of the "Content-ID" header field. Returns
 * <code>null</code> if the field is unavailable or its value is 
 * absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
public String getContentID() throws MessagingException {
return getHeader("Content-Id", null);
}

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

/**
 * Returns the value of the "Content-ID" header field. Returns
 * <code>null</code> if the field is unavailable or its value is 
 * absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
@Override
public String getContentID() throws MessagingException {
return getHeader("Content-Id", null);
}

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

/**
 * Return the value of the "Content-MD5" header field. Returns 
 * <code>null</code> if this field is unavailable or its value
 * is absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
public String getContentMD5() throws MessagingException {
return getHeader("Content-MD5", null);
}

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

/**
 * Return the value of the "Content-MD5" header field. Returns 
 * <code>null</code> if this field is unavailable or its value
 * is absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
@Override
public String getContentMD5() throws MessagingException {
return getHeader("Content-MD5", null);
}

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

public String[] getHeader(String name) throws MessagingException {
loadHeaders();
return super.getHeader(name);
}

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

@Override
public String[] getHeader(String name) throws MessagingException {
loadHeaders();
return super.getHeader(name);
}

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

/**
 * Returns the value of the RFC 822 "Content-Type" header field.
 * This represents the content type of the content of this
 * body part. This value must not be null. If this field is
 * unavailable, "text/plain" should be returned. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 *
 * @return    Content-Type of this body part
 */
public String getContentType() throws MessagingException {
String s = getHeader("Content-Type", null);
s = MimeUtil.cleanContentType(this, s);
if (s == null)
  s = "text/plain";
return s;
}

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

/**
 * Returns the value of the RFC 822 "Content-Type" header field.
 * This represents the content type of the content of this
 * body part. This value must not be null. If this field is
 * unavailable, "text/plain" should be returned. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 *
 * @return    Content-Type of this body part
 */
@Override
public String getContentType() throws MessagingException {
String s = getHeader("Content-Type", null);
s = MimeUtil.cleanContentType(this, s);
if (s == null)
  s = "text/plain";
return s;
}

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

/**
 * Returns the value of the "Content-ID" header field. Returns
 * <code>null</code> if the field is unavailable or its value is 
 * absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
@Override
public String getContentID() throws MessagingException {
return getHeader("Content-Id", null);
}

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

private String getSingleHeader(String name) throws MessagingException {
  String[] values = getHeader(name);
  if (values == null || values.length == 0) {
    return null;
  } else {
    return values[0];
  }
}

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

/**
 * Returns the value of the "Content-ID" header field. Returns
 * <code>null</code> if the field is unavailable or its value is 
 * absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
public String getContentID() throws MessagingException {
return getHeader("Content-Id", null);
}

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

/**
 * Returns the value of the "Content-ID" header field. Returns
 * <code>null</code> if the field is unavailable or its value is 
 * absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
public String getContentID() throws MessagingException {
return getHeader("Content-Id", null);
}

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

/**
 * Return the value of the "Content-MD5" header field. Returns 
 * <code>null</code> if this field is unavailable or its value
 * is absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
@Override
public String getContentMD5() throws MessagingException {
return getHeader("Content-MD5", null);
}

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

/**
 * Returns the value of the "Content-ID" header field. Returns
 * <code>null</code> if the field is unavailable or its value is 
 * absent. <p>
 *
 * This implementation uses <code>getHeader(name)</code>
 * to obtain the requisite header field.
 */
@Override
public String getContentID() throws MessagingException {
return getHeader("Content-Id", null);
}

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

private String getSingleHeader(String name) throws MessagingException {
    String[] values = getHeader(name);
    if (values == null || values.length == 0) {
      return null;
    } else {
      return values[0];
    }
  }
}

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

@Override
public String[] getHeader(String name) throws MessagingException {
loadHeaders();
return super.getHeader(name);
}

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

@Override
public String[] getHeader(String name) throws MessagingException {
loadHeaders();
return super.getHeader(name);
}

相关文章