org.finj
Class FTPException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.finj.FTPException
All Implemented Interfaces:
java.io.Serializable

public class FTPException
extends java.lang.RuntimeException

Exceptions thrown by an instance of org.finj.FTPClient built around a org.finj.FTPResponse, when the server refuses the actipon the org.finj.FTPClient was supposed to perform.

Copyright (C) 2000-2008 Javier Iglesias.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Version:
$Id: FTPException.java 47 2008-01-11 23:09:46Z jiglesias $
Author:
Javier Iglesias -- jiglesias@users.sourceforge.net
See Also:
Serialized Form

Constructor Summary
FTPException(java.lang.Object source, int code, java.lang.String message)
          Constructs a new instance of this class that will carry the org.finj.FTPResponse code and the original message received from the FTP server.
 
Method Summary
static FTPException createInvalidResponseException(java.lang.Object source, int code, java.lang.String cmd)
          Utility routine that composes the message used for FTPExceptions.
 int getCode()
          Returns the org.finj.FTPResponse code produced by the FTP server that triggered this Exception.
 java.lang.String getMessage()
          Returns the original message produced by the FTP server that triggered this Exception.
 java.lang.Object getSource()
          Returns the Object that throwed this Exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FTPException

public FTPException(java.lang.Object source,
                    int code,
                    java.lang.String message)
Constructs a new instance of this class that will carry the org.finj.FTPResponse code and the original message received from the FTP server.

Parameters:
source - Object that throwed this Exception.
code - one of the org.finj.FTPResponse error codes.
message - original response from the FTP server that trigered this Exception.
Since:
v1.0
Method Detail

getSource

public java.lang.Object getSource()
Returns the Object that throwed this Exception.

Returns:
Object that throwed the Exception
Since:
v1.0

getCode

public int getCode()
Returns the org.finj.FTPResponse code produced by the FTP server that triggered this Exception.

Returns:
one of the org.finj.FTPResponse error codes
Since:
v1.0

getMessage

public java.lang.String getMessage()
Returns the original message produced by the FTP server that triggered this Exception.

Overrides:
getMessage in class java.lang.Throwable
Returns:
message original response from the FTP server
Since:
v1.0

createInvalidResponseException

public static FTPException createInvalidResponseException(java.lang.Object source,
                                                          int code,
                                                          java.lang.String cmd)
Utility routine that composes the message used for FTPExceptions.

Parameters:
cmd - FTP command name that triggered the FTPException.
Returns:
standard exception message.
Since:
v1.0


Copyright © 2009. All Rights Reserved.