Package javax.mail

Examples of javax.mail.Folder.create()


            if (config.getProtocol().equals(MailUtils.PROTOCOL_IMAP) || config.getProtocol().equals(MailUtils.PROTOCOL_IMAPS)) {
                if (copyTo != null) {
                    LOG.trace("IMAP message needs to be copied to {}", copyTo);
                    Folder destFolder = store.getFolder(copyTo);
                    if (!destFolder.exists()) {
                        destFolder.create(Folder.HOLDS_MESSAGES);
                    }
                    folder.copyMessages(new Message[]{mail}, destFolder);
                    LOG.trace("IMAP message {} copied to {}", mail, copyTo);
                }
            }
View Full Code Here


            if (config.getProtocol().equals(MailUtils.PROTOCOL_IMAP) || config.getProtocol().equals(MailUtils.PROTOCOL_IMAPS)) {
                if (copyTo != null) {
                    LOG.trace("IMAP message needs to be copied to {}", copyTo);
                    Folder destFolder = store.getFolder(copyTo);
                    if (!destFolder.exists()) {
                        destFolder.create(Folder.HOLDS_MESSAGES);
                    }
                    folder.copyMessages(new Message[]{mail}, destFolder);
                    LOG.trace("IMAP message {} copied to {}", mail, copyTo);
                }
            }
View Full Code Here

            if (config.getProtocol().equals(MailUtils.PROTOCOL_IMAP) || config.getProtocol().equals(MailUtils.PROTOCOL_IMAPS)) {
                if (copyTo != null) {
                    LOG.trace("IMAP message needs to be copied to {}", copyTo);
                    Folder destFolder = store.getFolder(copyTo);
                    if (!destFolder.exists()) {
                        destFolder.create(Folder.HOLDS_MESSAGES);
                    }
                    folder.copyMessages(new Message[]{mail}, destFolder);
                    LOG.trace("IMAP message {} copied to {}", mail, copyTo);
                }
            }
View Full Code Here

    if ("create".equals(hr.get("action"))) {
      try {
        tmpFldr = tmpEmailConn.userMsgStore.getFolder(folderName);

        if (!tmpFldr.exists()) {
            tmpFldr.create(Folder.HOLDS_MESSAGES);
        } else {
          props.put(connHandle + "mailError","Folder: " + folderName + " already exists");

          hr.request.log(Server.LOG_DIAGNOSTIC,connHandle,
                         "Folder: " + folderName + " already exists!");
View Full Code Here

        throw new IllegalStateException("\"Sent\" folder was null");
      }
      else
      {
        if (!folder.exists())
          folder.create(Folder.HOLDS_MESSAGES);

        folder.appendMessages(new Message[]{msg});
      }
    }
    // Need to do something better;  like a "Warning: message sent, but not
View Full Code Here

        throw new IllegalStateException("\"Drafts\" folder was null");
      }
      else
      {
        if (!folder.exists())
          folder.create(Folder.HOLDS_MESSAGES);
       
        folder.appendMessages(new Message[]{msg});
      }
    }
    // Need to do something better...
View Full Code Here

            if (config.getProtocol().equals(MailUtils.PROTOCOL_IMAP) || config.getProtocol().equals(MailUtils.PROTOCOL_IMAPS)) {
                if (copyTo != null) {
                    LOG.trace("IMAP message needs to be copied to {}", copyTo);
                    Folder destFolder = store.getFolder(copyTo);
                    if (!destFolder.exists()) {
                        destFolder.create(Folder.HOLDS_MESSAGES);
                    }
                    folder.copyMessages(new Message[]{mail}, destFolder);
                    LOG.trace("IMAP message {} copied to {}", mail, copyTo);
                }
            }
View Full Code Here

            if (config.getProtocol().equals(MailUtils.PROTOCOL_IMAP) || config.getProtocol().equals(MailUtils.PROTOCOL_IMAPS)) {
                if (copyTo != null) {
                    LOG.trace("IMAP message needs to be copied to {}", copyTo);
                    Folder destFolder = store.getFolder(copyTo);
                    if (!destFolder.exists()) {
                        destFolder.create(Folder.HOLDS_MESSAGES);
                    }
                    folder.copyMessages(new Message[]{mail}, destFolder);
                    LOG.trace("IMAP message {} copied to {}", mail, copyTo);
                }
            }
View Full Code Here

            if (config.getProtocol().equals(MailUtils.PROTOCOL_IMAP) || config.getProtocol().equals(MailUtils.PROTOCOL_IMAPS)) {
                if (copyTo != null) {
                    LOG.trace("IMAP message needs to be copied to {}", copyTo);
                    Folder destFolder = store.getFolder(copyTo);
                    if (!destFolder.exists()) {
                        destFolder.create(Folder.HOLDS_MESSAGES);
                    }
                    folder.copyMessages(new Message[]{mail}, destFolder);
                    LOG.trace("IMAP message {} copied to {}", mail, copyTo);
                }
            }
View Full Code Here

    Folder[] sourceFolders = sourceFolder.list();
    for (Folder sourceSubFolder : sourceFolders) {
      Folder targetSubFolder = targetFolder.getFolder(sourceSubFolder.getName());
      if (!targetSubFolder.exists()) {
        log.debug("Creating target Folder: " + targetSubFolder.getFullName());
        targetSubFolder.create(sourceSubFolder.getType());
      }
      notifyToListeners(targetSubFolder);
      copyFolderAndMessages(sourceSubFolder, targetSubFolder, false);
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.