Example usage for javax.mail NoSuchProviderException NoSuchProviderException

List of usage examples for javax.mail NoSuchProviderException NoSuchProviderException

Introduction

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

Prototype

public NoSuchProviderException(String message) 

Source Link

Document

Constructs a NoSuchProviderException with the specified detail message.

Usage

From source file:com.alvexcore.repo.emails.impl.ExtendedEmailMessage.java

protected EmailProvider getEmailProvider(String id) throws NoSuchProviderException {
    EmailProvider provider = null;// ww  w .j a va 2s  .co  m
    for (EmailProvider p : getProviders())
        if (p.getId().equals(id))
            provider = p;
    if (provider == null)
        throw new NoSuchProviderException("Specified email provider not found");
    return provider;
}