Package javax.mail.search

Examples of javax.mail.search.SentDateTerm


    public SearchTermBuilder sent(Comparison comparison, Date date) {
        return sent(Op.and, comparison, date);
    }

    public SearchTermBuilder sent(Op op, Comparison comparison, Date date) {
        SentDateTerm st = new SentDateTerm(comparison.asNum(), date);
        addTerm(op, st);
        return this;
    }
View Full Code Here


            case CC:
                seekStrategy = new RecipientStringTerm(Message.RecipientType.CC,value);
                LOG.debug("Fetching emails CC'd to \"" + value + "\"");
                break;
            case DATE_GT:
                seekStrategy = new SentDateTerm(SentDateTerm.GT, parseDate(value));
                LOG.debug("Fetching emails with a send date newer than \"" + value + "\"");
                break;
            case DATE_LT:
                seekStrategy = new SentDateTerm(SentDateTerm.LT, parseDate(value));
                LOG.debug("Fetching emails with a send date newer than \"" + value + "\"");
                break;
            case DATE_EQ:
                seekStrategy = new SentDateTerm(SentDateTerm.EQ,parseDate(value));
                LOG.debug("Fetching emails with a send date newer than \"" + value + "\"");
                break;
            case KEYWORD:
                seekStrategy = new BodyTerm(value);
                LOG.debug("Fetching emails containing the keyword \"" + value + "\"");
View Full Code Here

            case CC:
                seekStrategy = new RecipientStringTerm(Message.RecipientType.CC,value);
                LOG.debug("Fetching emails CC'd to \"" + value + "\"");
                break;
            case DATE_GT:
                seekStrategy = new SentDateTerm(SentDateTerm.GT, parseDate(value));
                LOG.debug("Fetching emails with a send date newer than \"" + value + "\"");
                break;
            case DATE_LT:
                seekStrategy = new SentDateTerm(SentDateTerm.LT, parseDate(value));
                LOG.debug("Fetching emails with a send date newer than \"" + value + "\"");
                break;
            case DATE_EQ:
                seekStrategy = new SentDateTerm(SentDateTerm.EQ,parseDate(value));
                LOG.debug("Fetching emails with a send date newer than \"" + value + "\"");
                break;
            case KEYWORD:
                seekStrategy = new BodyTerm(value);
                LOG.debug("Fetching emails containing the keyword \"" + value + "\"");
View Full Code Here

                    if (msgs != null && msgs.length > 0) {
                        moveMessages(msgs, source, getFolder(rule.getDestFolder(), Folder.READ_WRITE));
                    }
                } else if (rule.getOlderThan() > 0) {
                    LocalDateTime day = LocalDateTime.now().minusDays(rule.getOlderThan());
                    SentDateTerm term = new SentDateTerm(ComparisonTerm.LE,
                            Date.from(day.toLocalDate().atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
                    Message[] msgs = source.search(term);
                    if (msgs != null && msgs.length > 0) {
                        deleteMessages(msgs, source);
                    }
View Full Code Here

TOP

Related Classes of javax.mail.search.SentDateTerm

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.