
org.subethamail.smtp.RejectException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of subethasmtp Show documentation
Show all versions of subethasmtp Show documentation
A fork of a fork (!) of SubEtha, an easy-to-use server-side SMTP library for Java.
/*
* $Id$
* $Source: /cvsroot/Similarity4/src/java/com/similarity/mbean/BindStatisticsManagerMBean.java,v $
*/
package org.subethamail.smtp;
/**
* Thrown to reject an SMTP command with a specific code.
*
* @author Jeff Schnitzer
*/
@SuppressWarnings("serial")
public class RejectException extends Exception
{
public static final int DEFAULT_CODE = 554;
public static final String DEFAULT_MESSAGE = "Transaction failed";
final int code;
public RejectException()
{
this(DEFAULT_MESSAGE);
}
public RejectException(String message)
{
this(DEFAULT_CODE, message);
}
public RejectException(int code, String message)
{
super(message, null, true, false);
this.code = code;
}
public int getCode()
{
return this.code;
}
public String getErrorResponse()
{
return this.code + " " + this.getMessage();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy