Package javax.mail

Examples of javax.mail.FetchProfile$Item


     * @param folder   the folder to fetch messages from
     * @param messages the messages to fetch
     * @throws MessagingException in case of JavMail errors
     */
    protected void fetchMessages(Folder folder, Message[] messages) throws MessagingException {
        FetchProfile contentsProfile = new FetchProfile();
        contentsProfile.add(FetchProfile.Item.ENVELOPE);
        contentsProfile.add(FetchProfile.Item.CONTENT_INFO);
        contentsProfile.add(FetchProfile.Item.FLAGS);
        folder.fetch(messages, contentsProfile);
    }
View Full Code Here


  {
    if (_holdsMessages)
    {
      if (_messageListModel == null)
      {
        FetchProfile fetchProfile = new FetchProfile();
        fetchProfile.add(FetchProfile.Item.ENVELOPE);
        fetchProfile.add(FetchProfile.Item.FLAGS);
        _messageListModel = new MessageDataModel(_folder,
                                                 fetchProfile,
                                                 _MESSAGE_LOAD_BLOCK_SIZE);
      }
View Full Code Here

            addResult(aFolder);

            Message[] messages = aFolder.getMessages();

            // Use a suitable FetchProfile
            FetchProfile fp = new FetchProfile();
            fp.add(FetchProfile.Item.ENVELOPE);
            fp.add(FetchProfile.Item.FLAGS);
            fp.add("X-Mailer");
            aFolder.fetch(messages, fp);

            // add all messages to the result
            addResult(messages);
View Full Code Here

            addResult(aFolder);

            Message[] messages = aFolder.getMessages();

            // Use a suitable FetchProfile
            FetchProfile fp = new FetchProfile();
            fp.add(FetchProfile.Item.ENVELOPE);
            fp.add(FetchProfile.Item.FLAGS);
            fp.add("X-Mailer");
            aFolder.fetch(messages, fp);

            // add all messages to the result
            addResult(messages);
View Full Code Here

                return;
            }

            // get all messages
            Message[] messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));
            FetchProfile profile = new FetchProfile();
            profile.add(FetchProfile.Item.ENVELOPE);
            profile.add(FetchProfile.Item.FLAGS);
            profile.add("X-Mailer");
            folder.fetch(messages, profile);

            // process each message
            for (Message message: messages) {
                // process each un-read message
View Full Code Here

 
  private void prefetchMessages( Folder folder, Message[] msgList ) throws MessagingException
  {
    // Prefetch all the key information and headers
   
    FetchProfile fp = new FetchProfile();
    fp.add( FetchProfile.Item.ENVELOPE );
   
        for (String PREFETCH_HEADER : PREFETCH_HEADERS) {
            fp.add(PREFETCH_HEADER);
        }
    folder.fetch( msgList, fp );
  }
View Full Code Here

            addResult(aFolder);

            Message[] messages = aFolder.getMessages();

            // Use a suitable FetchProfile
            FetchProfile fp = new FetchProfile();
            fp.add(FetchProfile.Item.ENVELOPE);
            fp.add(FetchProfile.Item.FLAGS);
            fp.add("X-Mailer");
            aFolder.fetch(messages, fp);

            // add all messages to the result
            addResult(messages);
View Full Code Here

            addResult(aFolder);

            Message[] messages = aFolder.getMessages();

            // Use a suitable FetchProfile
            FetchProfile fp = new FetchProfile();
            fp.add(FetchProfile.Item.ENVELOPE);
            fp.add(FetchProfile.Item.FLAGS);
            fp.add("X-Mailer");
            aFolder.fetch(messages, fp);

            // add all messages to the result
            addResult(messages);
View Full Code Here

        msgs = folder.getMessages();
        logger
            .debug( "Millis for getting " + msgs.length + " messages: "
                + (System.currentTimeMillis() - time) );
        time = System.currentTimeMillis();
        FetchProfile fp = MessageUtils.createFetchProfile( false, sortfield );

        logger.debug( "Start fetching messages..." );
        folder.fetch( msgs, fp );
        logger.debug( "Millis for fetching " + msgs.length + " Messages: "
            + (System.currentTimeMillis() - time) );
View Full Code Here

   * @param sortfield
   * @return
   */
  public static FetchProfile createFetchProfile( boolean complete, String sortfield ) {

    FetchProfile fp = new FetchProfile();
    if ( complete ) {
      fp.add( FetchProfile.Item.ENVELOPE );
      fp.add( FetchProfile.Item.FLAGS );
      fp.add( FetchProfile.Item.CONTENT_INFO );
      fp.add( IMAPFolder.FetchProfileItem.SIZE );
      fp.add( CubusConstants.FETCH_ITEM_PRIORITY );
      fp.add( UIDFolder.FetchProfileItem.UID );
    }
    else {
      if ( sortfield != null ) {
        if ( MessageListFields.ATTACHMENT_FLAG.name().equals( sortfield ) ) {
          fp.add( FetchProfile.Item.CONTENT_INFO );
        }
        else if ( MessageListFields.SUBJECT.name().equals( sortfield )
            || MessageListFields.FROM.name().equals( sortfield )
            || MessageListFields.TO.name().equals( sortfield )
            || MessageListFields.DATE.name().equals( sortfield ) ) {
          fp.add( FetchProfile.Item.ENVELOPE );
        }
        else if ( MessageListFields.SIZE.name().equals( sortfield ) ) {
          fp.add( IMAPFolder.FetchProfileItem.SIZE );
        }
      }
    }
    return fp;
  }
View Full Code Here

TOP

Related Classes of javax.mail.FetchProfile$Item

Copyright © 2018 www.massapicom. 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.