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

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

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

MimeBodyPart.getEncoding介绍

[英]Returns the content transfer encoding from the "Content-Transfer-Encoding" header field. Returns null if the header is unavailable or its value is absent.

This implementation uses getHeader(name) to obtain the requisite header field.
[中]从“内容传输编码”标题字段返回内容传输编码。如果标头不可用或其值不存在,则返回null
此实现使用getHeader(name)来获取必需的头字段。

代码示例

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. public String getEncoding() throws MessagingException {
  13. return getEncoding(this);
  14. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses the <code>getHeader</code> method
  8. * to obtain the requisite header field.
  9. *
  10. * @return content-transfer-encoding
  11. * @exception MessagingException for failures
  12. */
  13. public String getEncoding() throws MessagingException {
  14. return MimeBodyPart.getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. @Override
  13. public String getEncoding() throws MessagingException {
  14. return getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses the <code>getHeader</code> method
  8. * to obtain the requisite header field.
  9. *
  10. * @return content-transfer-encoding
  11. * @exception MessagingException for failures
  12. */
  13. @Override
  14. public String getEncoding() throws MessagingException {
  15. return MimeBodyPart.getEncoding(this);
  16. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. @Override
  13. public String getEncoding() throws MessagingException {
  14. return getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. @Override
  13. public String getEncoding() throws MessagingException {
  14. return getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses the <code>getHeader</code> method
  8. * to obtain the requisite header field.
  9. *
  10. * @return content-transfer-encoding
  11. * @exception MessagingException for failures
  12. */
  13. @Override
  14. public String getEncoding() throws MessagingException {
  15. return MimeBodyPart.getEncoding(this);
  16. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. public String getEncoding() throws MessagingException {
  13. return getEncoding(this);
  14. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. @Override
  13. public String getEncoding() throws MessagingException {
  14. return getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses the <code>getHeader</code> method
  8. * to obtain the requisite header field.
  9. *
  10. * @return content-transfer-encoding
  11. * @exception MessagingException for failures
  12. */
  13. @Override
  14. public String getEncoding() throws MessagingException {
  15. return MimeBodyPart.getEncoding(this);
  16. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. public String getEncoding() throws MessagingException {
  13. return getEncoding(this);
  14. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses the <code>getHeader</code> method
  8. * to obtain the requisite header field.
  9. *
  10. * @return content-transfer-encoding
  11. * @exception MessagingException
  12. */
  13. public String getEncoding() throws MessagingException {
  14. return MimeBodyPart.getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses the <code>getHeader</code> method
  8. * to obtain the requisite header field.
  9. *
  10. * @return content-transfer-encoding
  11. * @exception MessagingException for failures
  12. */
  13. @Override
  14. public String getEncoding() throws MessagingException {
  15. return MimeBodyPart.getEncoding(this);
  16. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses the <code>getHeader</code> method
  8. * to obtain the requisite header field.
  9. *
  10. * @return content-transfer-encoding
  11. * @exception MessagingException for failures
  12. */
  13. @Override
  14. public String getEncoding() throws MessagingException {
  15. return MimeBodyPart.getEncoding(this);
  16. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses the <code>getHeader</code> method
  8. * to obtain the requisite header field.
  9. *
  10. * @return content-transfer-encoding
  11. * @exception MessagingException
  12. */
  13. public String getEncoding() throws MessagingException {
  14. return MimeBodyPart.getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. @Override
  13. public String getEncoding() throws MessagingException {
  14. return getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. @Override
  13. public String getEncoding() throws MessagingException {
  14. return getEncoding(this);
  15. }

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

  1. /**
  2. * Returns the content transfer encoding from the
  3. * "Content-Transfer-Encoding" header
  4. * field. Returns <code>null</code> if the header is unavailable
  5. * or its value is absent. <p>
  6. *
  7. * This implementation uses <code>getHeader(name)</code>
  8. * to obtain the requisite header field.
  9. *
  10. * @see #headers
  11. */
  12. @Override
  13. public String getEncoding() throws MessagingException {
  14. return getEncoding(this);
  15. }

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

  1. public void writeTo(OutputStream out) throws IOException, MessagingException {
  2. headers.writeTo(out, null);
  3. // add the separater between the headers and the data portion.
  4. out.write('\r');
  5. out.write('\n');
  6. // we need to process this using the transfer encoding type
  7. OutputStream encodingStream = MimeUtility.encode(out, getEncoding());
  8. getDataHandler().writeTo(encodingStream);
  9. encodingStream.flush();
  10. }

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

  1. public void writeTo(OutputStream out) throws IOException, MessagingException {
  2. headers.writeTo(out, null);
  3. // add the separater between the headers and the data portion.
  4. out.write('\r');
  5. out.write('\n');
  6. // we need to process this using the transfer encoding type
  7. OutputStream encodingStream = MimeUtility.encode(out, getEncoding());
  8. getDataHandler().writeTo(encodingStream);
  9. encodingStream.flush();
  10. }

相关文章