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

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

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

MimeBodyPart.getDisposition介绍

[英]Returns the disposition from the "Content-Disposition" header field. This represents the disposition of this part. The disposition describes how the part should be presented to the user.

If the Content-Disposition field is unavailable, null is returned.

This implementation uses getHeader(name) to obtain the requisite header field.
[中]从“内容处置”标题字段返回处置。这表示该部件的配置。处置描述了零件应如何呈现给用户。
如果内容处置字段不可用,则返回null。
此实现使用getHeader(name)获取必需的头字段。

代码示例

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @exception MessagingException for failures
  13. * @see #headers
  14. */
  15. public String getDisposition() throws MessagingException {
  16. return getDisposition(this);
  17. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * <code>null</code> is returned. <p>
  8. *
  9. * This implementation uses the <code>getHeader</code> method
  10. * to obtain the requisite header field.
  11. *
  12. * @return disposition of this part, or null if unknown
  13. * @exception MessagingException for failures
  14. */
  15. public String getDisposition() throws MessagingException {
  16. return MimeBodyPart.getDisposition(this);
  17. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * <code>null</code> is returned. <p>
  8. *
  9. * This implementation uses the <code>getHeader</code> method
  10. * to obtain the requisite header field.
  11. *
  12. * @return disposition of this part, or null if unknown
  13. * @exception MessagingException for failures
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return MimeBodyPart.getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @exception MessagingException for failures
  13. * @see #headers
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @exception MessagingException for failures
  13. * @see #headers
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * <code>null</code> is returned. <p>
  8. *
  9. * This implementation uses the <code>getHeader</code> method
  10. * to obtain the requisite header field.
  11. *
  12. * @return disposition of this part, or null if unknown
  13. * @exception MessagingException for failures
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return MimeBodyPart.getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the value of the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @see #headers
  13. */
  14. public String getDisposition() throws MessagingException {
  15. return getDisposition(this);
  16. }

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

  1. /**
  2. * Returns the value of the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @see #headers
  13. */
  14. public String getDisposition() throws MessagingException {
  15. return getDisposition(this);
  16. }

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

  1. /**
  2. * Returns the value of the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * <code>null</code> is returned. <p>
  8. *
  9. * This implementation uses the <code>getHeader</code> method
  10. * to obtain the requisite header field.
  11. *
  12. * @return disposition of this part, or null if unknown
  13. * @exception MessagingException
  14. */
  15. public String getDisposition() throws MessagingException {
  16. return MimeBodyPart.getDisposition(this);
  17. }

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

  1. /**
  2. * Returns the value of the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * <code>null</code> is returned. <p>
  8. *
  9. * This implementation uses the <code>getHeader</code> method
  10. * to obtain the requisite header field.
  11. *
  12. * @return disposition of this part, or null if unknown
  13. * @exception MessagingException
  14. */
  15. public String getDisposition() throws MessagingException {
  16. return MimeBodyPart.getDisposition(this);
  17. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * <code>null</code> is returned. <p>
  8. *
  9. * This implementation uses the <code>getHeader</code> method
  10. * to obtain the requisite header field.
  11. *
  12. * @return disposition of this part, or null if unknown
  13. * @exception MessagingException for failures
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return MimeBodyPart.getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @exception MessagingException for failures
  13. * @see #headers
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * <code>null</code> is returned. <p>
  8. *
  9. * This implementation uses the <code>getHeader</code> method
  10. * to obtain the requisite header field.
  11. *
  12. * @return disposition of this part, or null if unknown
  13. * @exception MessagingException for failures
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return MimeBodyPart.getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * <code>null</code> is returned. <p>
  8. *
  9. * This implementation uses the <code>getHeader</code> method
  10. * to obtain the requisite header field.
  11. *
  12. * @return disposition of this part, or null if unknown
  13. * @exception MessagingException for failures
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return MimeBodyPart.getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @exception MessagingException for failures
  13. * @see #headers
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @exception MessagingException for failures
  13. * @see #headers
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return getDisposition(this);
  18. }

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

  1. /**
  2. * Returns the disposition from the "Content-Disposition" header field.
  3. * This represents the disposition of this part. The disposition
  4. * describes how the part should be presented to the user. <p>
  5. *
  6. * If the Content-Disposition field is unavailable,
  7. * null is returned. <p>
  8. *
  9. * This implementation uses <code>getHeader(name)</code>
  10. * to obtain the requisite header field.
  11. *
  12. * @exception MessagingException for failures
  13. * @see #headers
  14. */
  15. @Override
  16. public String getDisposition() throws MessagingException {
  17. return getDisposition(this);
  18. }

代码示例来源:origin: stackoverflow.com

  1. Multipart multiPart = (Multipart) message.getContent();
  2. for (int i = 0; i < multiPart.getCount(); i++) {
  3. MimeBodyPart part = (MimeBodyPart) multiPart.getBodyPart(i);
  4. if (Part.ATTACHMENT.equalsIgnoreCase(part.getDisposition())) {
  5. // this part is attachment
  6. // code to save attachment...
  7. }
  8. }

代码示例来源:origin: stackoverflow.com

  1. if (mimeMessage.getContentType().contains("multipart")) {
  2. Multipart multiPart = (Multipart) mimeMessage.getContent();
  3. messageContent = (String)messageContent;
  4. messageContent = "";
  5. for (int partCount = 0; partCount < multiPart.getCount(); partCount++) {
  6. MimeBodyPart part = (MimeBodyPart) multiPart
  7. .getBodyPart(partCount);
  8. if (!Part.ATTACHMENT
  9. .equalsIgnoreCase(part.getDisposition())) {
  10. // this part is the message content
  11. content = getText(part,embededImgMap);
  12. }
  13. }
  14. }

代码示例来源:origin: stackoverflow.com

  1. if( mimeMessage.getContent() instanceof Multipart) {
  2. Multipart multipartContent = (Multipart) mimeMessage.getContent();
  3. List<BodyPart> deleteThese = new ArrayList<BodyPart>();
  4. for( int i = 0; i < multipartContent.getCount(); i++ ) {
  5. MimeBodyPart part = (MimeBodyPart) multipartContent.getBodyPart(i);
  6. String disposition = part.getDisposition();
  7. if( disposition != null
  8. && ( disposition.equalsIgnoreCase( Part.ATTACHMENT )
  9. || ( disposition.equalsIgnoreCase( Part.INLINE )
  10. && !part.isMimeType( PLAIN_TEXT_MIME_TYPE )
  11. && !part.isMimeType( HTML_MIME_TYPE ) )
  12. ) ) {
  13. // do something with part
  14. }
  15. }

相关文章