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

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

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

MimeMessage.getFolder介绍

暂无

代码示例

代码示例来源:origin: org.apache.james/james-server-core-library

/**
 * @see javax.mail.Message#getFolder()
 */
public Folder getFolder() {
  return getWrappedMessage().getFolder();
}

代码示例来源:origin: com.axway.ats.framework/ats-actionlibrary

/**
 * Create a MIME package from an existing message
 *
 * @param message
 * @throws PackageException
 */
@PublicAtsApi
public MimePackage( MimeMessage message ) throws PackageException {
  this.message = message;
  partOfImapFolder = message.getFolder(); // initial best effort. Null for nested or newly created MimeMessages
  decompose();
}

代码示例来源:origin: com.axway.ats.framework/ats-actionlibrary

/**
 * Load a MIME package from an existing source
 *
 * @param packageStream
 *            the stream with the package content
 *
 * @throws PackageException
 */
@PublicAtsApi
public MimePackage( InputStream packageStream ) throws PackageException {
  try {
    this.message = new MimeMessage(Session.getInstance(new Properties()), packageStream);
    partOfImapFolder = message.getFolder(); // initial best effort. Null for nested or newly created MimeMessages
  } catch (MessagingException me) {
    throw new PackageException(me);
  }
  decompose();
}

代码示例来源:origin: com.axway.ats.framework/ats-actionlibrary

/**
 * Close connection
 * <b>Note</b>Internal method
 * @throws MessagingException
 */
public void closeStoreConnection(
                 boolean storeConnected ) throws MessagingException {
  if (storeConnected) {
    // the folder is empty when the message is not loaded from IMAP server, but from a file
    Folder imapFolder = message.getFolder();
    if (imapFolder == null) {
      imapFolder = partOfImapFolder; // in case of nested package but still originating from IMAP server
    }
    if (imapFolder != null) {
      Store store = imapFolder.getStore();
      if (store != null && store.isConnected()) {
        // closing store closes and its folders
        log.debug("Closing store (" + store.toString() + ") and associated folders");
        store.close();
      }
    }
  }
}

代码示例来源:origin: com.axway.ats.framework/ats-actionlibrary

Folder imapFolder = message.getFolder();
if (imapFolder == null) {
  imapFolder = this.partOfImapFolder;

相关文章

MimeMessage类方法