Example usage for javax.mail.search FromStringTerm FromStringTerm

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

Introduction

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

Prototype

public FromStringTerm(String pattern) 

Source Link

Document

Constructor.

Usage

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

/**
 * Set filter on message sender./*from   w w w  .  ja v a  2 s . c  o m*/
 *
 * @param sender
 *          messages will be filtered on sender
 * @param notTerm
 *          negate condition
 */
public void setSenderTerm(String sender, boolean notTerm) {
    if (!Utils.isEmpty(sender)) {
        if (notTerm) {
            addSearchTerm(new NotTerm(new FromStringTerm(sender)));
        } else {
            addSearchTerm(new FromStringTerm(sender));
        }
    }
}