001: /**
002: *
003: * Java FTP client library.
004: *
005: * Copyright (C) 2000-2003 Enterprise Distributed Technologies Ltd
006: *
007: * www.enterprisedt.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
022: *
023: * Bug fixes, suggestions and comments should be sent to bruce@enterprisedt.com
024: *
025: * Change Log:
026: *
027: * $Log: FTPException.java,v $
028: * Revision 1.1.1.1 2005/06/23 15:22:58 smontoro
029: * hipergate backend
030: *
031: * Revision 1.1 2004/02/07 03:15:20 hipergate
032: * v2.0 pre-alpha
033: *
034: * Revision 1.4 2002/11/19 22:01:25 bruceb
035: * changes for 1.2
036: *
037: * Revision 1.3 2001/10/09 20:54:08 bruceb
038: * No change
039: *
040: * Revision 1.1 2001/10/05 14:42:04 bruceb
041: * moved from old project
042: *
043: */package com.enterprisedt.net.ftp;
044:
045: /**
046: * FTP specific exceptions
047: *
048: * @author Bruce Blackshaw
049: * @version $Revision: 1.1.1.1 $
050: *
051: */
052: public class FTPException extends Exception {
053:
054: /**
055: * Revision control id
056: */
057: private static String cvsId = "@(#)$Id: FTPException.java,v 1.1.1.1 2005/06/23 15:22:58 smontoro Exp $";
058:
059: /**
060: * Integer reply code
061: */
062: private int replyCode = -1;
063:
064: /**
065: * Constructor. Delegates to super.
066: *
067: * @param msg Message that the user will be
068: * able to retrieve
069: */
070: public FTPException(String msg) {
071: super (msg);
072: }
073:
074: /**
075: * Constructor. Permits setting of reply code
076: *
077: * @param msg message that the user will be
078: * able to retrieve
079: * @param replyCode string form of reply code
080: */
081: public FTPException(String msg, String replyCode) {
082:
083: super (msg);
084:
085: // extract reply code if possible
086: try {
087: this .replyCode = Integer.parseInt(replyCode);
088: } catch (NumberFormatException ex) {
089: this .replyCode = -1;
090: }
091: }
092:
093: /**
094: * Get the reply code if it exists
095: *
096: * @return reply if it exists, -1 otherwise
097: */
098: public int getReplyCode() {
099: return replyCode;
100: }
101:
102: }
|