Package javax.mail.search

Examples of javax.mail.search.FlagTerm


            if (count > 0) {
                Message[] messages;

                // should we process all messages or only unseen messages
                if (endpoint.getConfiguration().isProcessOnlyUnseenMessages()) {
                    messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));
                } else {
                    messages = folder.getMessages();
                }

                processMessages(messages);
View Full Code Here


        }
        Flags supportedFlags = folder.getPermanentFlags();
        SearchTerm searchTerm = null;
        if (supportedFlags != null) {
            if (supportedFlags.contains(Flags.Flag.RECENT)) {
                searchTerm = new FlagTerm(new Flags(Flags.Flag.RECENT), true);
            }
            if (supportedFlags.contains(Flags.Flag.ANSWERED)) {
                FlagTerm answeredTerm = new FlagTerm(new Flags(Flags.Flag.ANSWERED), false);
                if (searchTerm == null) {
                    searchTerm = answeredTerm;
                }
                else {
                    searchTerm = new AndTerm(searchTerm, answeredTerm);
                }
            }
            if (supportedFlags.contains(Flags.Flag.DELETED)) {
                FlagTerm deletedTerm = new FlagTerm(new Flags(Flags.Flag.DELETED), false);
                if (searchTerm == null) {
                    searchTerm = deletedTerm;
                }
                else {
                    searchTerm = new AndTerm(searchTerm, deletedTerm);
View Full Code Here

    // Retrieve the "Inbox"
    Folder inbox = store.getFolder("inbox");
    // Reading the Email Index in Read / Write Mode
    inbox.open(Folder.READ_WRITE);
    FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
    Message messages[] = inbox.search(ft);
    System.out.println(messages.length + " unread message");

    // Loop over all of the messages
    for (int i = messages.length - 1; i >= 0; i--) {
View Full Code Here

    // Retrieve the "Inbox"
    Folder inbox = store.getFolder("inbox");
    // Reading the Email Index in Read / Write Mode
    inbox.open(Folder.READ_WRITE);
    FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
    Message messages[] = inbox.search(ft);
    System.out.println(messages.length + " unread message");

    // Loop over all of the messages
    for (int i = messages.length - 1; i >= 0; i--) {
View Full Code Here

    try {
      // Retrieve the "Inbox"
      Folder inbox = store.getFolder("inbox");
      // Reading the Email Index in Read / Write Mode
      inbox.open(Folder.READ_WRITE);
      FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
      Message messages[] = inbox.search(ft);

      // Loop over all of the messages
      for (int i = messages.length - 1; i >= 0; i--) {
        Message message = messages[i];
View Full Code Here

    // Retrieve the "Inbox"
    Folder inbox = store.getFolder("inbox");
    // Reading the Email Index in Read / Write Mode
    inbox.open(Folder.READ_WRITE);
    FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
    Message messages[] = inbox.search(ft);

    // Loop over all of the messages
    for (int i = messages.length - 1; i >= 0; i--) {
      Message message = messages[i];
View Full Code Here

    // Retrieve the "Inbox"
    Folder inbox = store.getFolder("inbox");
    // Reading the Email Index in Read / Write Mode
    inbox.open(Folder.READ_WRITE);

    FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
    Message messages[] = inbox.search(ft);
    // Message messages[] = inbox.getMessages();

    // Loop over all of the messages
    for (Message message : messages) {
View Full Code Here

    // Retrieve the "Inbox"
    Folder inbox = store.getFolder("inbox");
    // Reading the Email Index in Read / Write Mode
    inbox.open(Folder.READ_WRITE);

    FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
    Message messages[] = inbox.search(ft);
    // Message messages[] = inbox.getMessages();
    int count = 0;
    // Loop over all of the messages
    for (Message message : messages) {
View Full Code Here

  {
    try
    {
      ArrayList<Resource> resources = new ArrayList<Resource>(limit);

      FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
      Folder inbox = store.getFolder("Inbox");
      inbox.open(Folder.READ_ONLY);
      Message messages[] = inbox.search(ft);

      for(int i = 0; i < messages.length && resources.size() < limit; i++)
View Full Code Here

    // Retrieve the "Inbox"
    Folder inbox = store.getFolder("inbox");
    // Reading the Email Index in Read / Write Mode
    inbox.open(Folder.READ_WRITE);
    FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
    Message messages[] = inbox.search(ft);
    System.out.println(messages.length + " unread message");

    // Loop over all of the messages
    for (int i = messages.length - 1; i >= 0; i--) {
View Full Code Here

TOP

Related Classes of javax.mail.search.FlagTerm

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.