Example usage for javax.mail.search ReceivedDateTerm ReceivedDateTerm

List of usage examples for javax.mail.search ReceivedDateTerm ReceivedDateTerm

Introduction

In this page you can find the example usage for javax.mail.search ReceivedDateTerm ReceivedDateTerm.

Prototype

public ReceivedDateTerm(int comparison, Date date) 

Source Link

Document

Constructor.

Usage

From source file:org.pentaho.di.job.entries.getpop.MailConnection.java

/**
 * Set filter on message received date.//from   ww w . j  a  v  a  2 s .c  o m
 *
 * @param futureDate
 *          messages will be filtered on futureDate
 */
public void setReceivedDateTermLT(Date futureDate) {
    if (this.protocol == MailConnectionMeta.PROTOCOL_POP3) {
        log.logError(BaseMessages.getString(PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported"));
    } else {
        addSearchTerm(new ReceivedDateTerm(ComparisonTerm.LT, futureDate));
    }
}

From source file:org.pentaho.di.job.entries.getpop.MailConnection.java

/**
 * Set filter on message received date./* www.j  av a 2  s. c  om*/
 *
 * @param pastDate
 *          messages will be filtered on pastDate
 */
public void setReceivedDateTermGT(Date pastDate) {
    if (this.protocol == MailConnectionMeta.PROTOCOL_POP3) {
        log.logError(BaseMessages.getString(PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported"));
    } else {
        addSearchTerm(new ReceivedDateTerm(ComparisonTerm.GT, pastDate));
    }
}

From source file:org.pentaho.di.job.entries.getpop.MailConnection.java

public void setReceivedDateTermBetween(Date beginDate, Date endDate) {
    if (this.protocol == MailConnectionMeta.PROTOCOL_POP3) {
        log.logError(BaseMessages.getString(PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported"));
    } else {// w w w.j  a  va 2 s  .c  o  m
        addSearchTerm(new AndTerm(new ReceivedDateTerm(ComparisonTerm.LT, endDate),
                new ReceivedDateTerm(ComparisonTerm.GT, beginDate)));
    }
}