//============================================================================== // FTPException.java //============================================================================== package tribble.net.ftp; import java.io.IOException; import java.lang.Exception; import java.lang.String; import java.lang.Throwable; /******************************************************************************* * Simple FTP exception. * Represents the I/O exceptions thrown by FTP clients and servers. * * * @version API 2.0 $Revision: 1.3 $ $Date: 2010/07/12 21:30:20 $ * @since API 1.0, 2006-05-09 * @author David R. Tribble (david@tribble.com). *
* Copyright ©2006-2010 by David R. Tribble, all rights reserved.
* Permission is granted to any person or entity except those designated
* by the United States Department of State as a terrorist, or terrorist
* government or agency, to use and distribute this source code provided
* that the original copyright notice remains present and unaltered.
*
* @see FTPClientI
* @see FTPClientAdapter
* @see FTPClient
*/
public class FTPException
extends java.io.IOException
{
/** Revision information. */
static final String REV =
"@(#)tribble/net/ftp/FTPException.java API 2.0 $Revision: 1.3 $ $Date: 2010/07/12 21:30:20 $\n";
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Variables
/** FTP error code associated with this exception (may be zero). */
private int m_code;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Constructors
/***************************************************************************
* Default constructor.
*
* @since 1.1, 2006-05-09
*/
public FTPException()
{ }
/***************************************************************************
* Constructor.
*
* @param msg
* Message detailing this exception.
*
* @since 1.1, 2006-05-09
*/
public FTPException(String msg)
{
super(msg);
}
/***************************************************************************
* Constructor.
*
* @param code
* FTP error code.
*
* @param msg
* Message detailing this exception.
*
* @since 1.2, 2006-06-03
*/
public FTPException(int code, String msg)
{
super(msg);
m_code = code;
}
/***************************************************************************
* Constructor.
*
* @param msg
* Message detailing this exception.
*
* @param cause
* Exception that caused this exception.
*
* @since 1.1, 2006-05-09
*/
public FTPException(String msg, Throwable cause)
{
super(msg);
initCause(cause);
}
/***************************************************************************
* Constructor.
*
* @param code
* FTP error code.
*
* @param msg
* Message detailing this exception.
*
* @param cause
* Exception that caused this exception.
*
* @since 1.2, 2006-06-03
*/
public FTPException(int code, String msg, Throwable cause)
{
super(msg);
initCause(cause);
m_code = code;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Methods
/***************************************************************************
* Retrieve the FTP error code associated with this exception.
*
* @return
* FTP error code, or zero if this exception has none.
*
* @since 1.2, 2006-06-03
*/
public int getErrorCode()
{
return m_code;
}
}
// End FTPException.java