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

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

本文整理了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

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

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

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

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

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

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

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

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

  1. /**
  2. * Returns the value of the "Content-ID" header field. Returns
  3. * <code>null</code> if the field is unavailable or its value is
  4. * absent. <p>
  5. *
  6. * This implementation uses <code>getHeader(name)</code>
  7. * to obtain the requisite header field.
  8. */
  9. @Override
  10. public String getContentID() throws MessagingException {
  11. return getHeader("Content-Id", null);
  12. }

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

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

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

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

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

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

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

  1. @Override
  2. public String[] getHeader(String name) throws MessagingException {
  3. loadHeaders();
  4. return super.getHeader(name);
  5. }

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

  1. /**
  2. * Returns the value of the RFC 822 "Content-Type" header field.
  3. * This represents the content type of the content of this
  4. * body part. This value must not be null. If this field is
  5. * unavailable, "text/plain" should be returned. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @return Content-Type of this body part
  11. */
  12. public String getContentType() throws MessagingException {
  13. String s = getHeader("Content-Type", null);
  14. s = MimeUtil.cleanContentType(this, s);
  15. if (s == null)
  16. s = "text/plain";
  17. return s;
  18. }

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

  1. /**
  2. * Returns the value of the RFC 822 "Content-Type" header field.
  3. * This represents the content type of the content of this
  4. * body part. This value must not be null. If this field is
  5. * unavailable, "text/plain" should be returned. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @return Content-Type of this body part
  11. */
  12. @Override
  13. public String getContentType() throws MessagingException {
  14. String s = getHeader("Content-Type", null);
  15. s = MimeUtil.cleanContentType(this, s);
  16. if (s == null)
  17. s = "text/plain";
  18. return s;
  19. }

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

  1. /**
  2. * Returns the value of the "Content-ID" header field. Returns
  3. * <code>null</code> if the field is unavailable or its value is
  4. * absent. <p>
  5. *
  6. * This implementation uses <code>getHeader(name)</code>
  7. * to obtain the requisite header field.
  8. */
  9. @Override
  10. public String getContentID() throws MessagingException {
  11. return getHeader("Content-Id", null);
  12. }

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

  1. private String getSingleHeader(String name) throws MessagingException {
  2. String[] values = getHeader(name);
  3. if (values == null || values.length == 0) {
  4. return null;
  5. } else {
  6. return values[0];
  7. }
  8. }

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

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

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

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

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

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

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

  1. /**
  2. * Returns the value of the "Content-ID" header field. Returns
  3. * <code>null</code> if the field is unavailable or its value is
  4. * absent. <p>
  5. *
  6. * This implementation uses <code>getHeader(name)</code>
  7. * to obtain the requisite header field.
  8. */
  9. @Override
  10. public String getContentID() throws MessagingException {
  11. return getHeader("Content-Id", null);
  12. }

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

  1. private String getSingleHeader(String name) throws MessagingException {
  2. String[] values = getHeader(name);
  3. if (values == null || values.length == 0) {
  4. return null;
  5. } else {
  6. return values[0];
  7. }
  8. }
  9. }

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

  1. @Override
  2. public String[] getHeader(String name) throws MessagingException {
  3. loadHeaders();
  4. return super.getHeader(name);
  5. }

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

  1. @Override
  2. public String[] getHeader(String name) throws MessagingException {
  3. loadHeaders();
  4. return super.getHeader(name);
  5. }

相关文章