1   /* FTPException.java
2    *
3    * $Id: FTPException.java 4573 2006-08-31 22:31:23Z paul_jack $
4    *
5    * Created on Jun 5, 2003
6    *
7    * Copyright (C) 2003 Internet Archive.
8    *
9    * This file is part of the Heritrix web crawler (crawler.archive.org).
10   *
11   * Heritrix is free software; you can redistribute it and/or modify
12   * it under the terms of the GNU Lesser Public License as published by
13   * the Free Software Foundation; either version 2.1 of the License, or
14   * any later version.
15   *
16   * Heritrix is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU Lesser Public License for more details.
20   *
21   * You should have received a copy of the GNU Lesser Public License
22   * along with Heritrix; if not, write to the Free Software
23   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24   */
25  package org.archive.net;
26  
27  
28  import java.io.IOException;
29  
30  import org.archive.crawler.fetcher.FetchFTP;
31  import org.archive.util.ArchiveUtils;
32  
33  
34  /***
35   * Indicates that a FTP operation failed due to a protocol violation.
36   * For instance, if authentication fails.
37   * 
38   * @author pjack
39   */
40  public class FTPException extends IOException {
41  
42  
43      /*** Serialization ID; robust against trivial API changes. */
44      private static final long serialVersionUID =
45       ArchiveUtils.classnameBasedUID(FetchFTP.class,1);
46  
47  
48      /***
49       * The reply code from the FTP server.
50       */
51      private int code;
52      
53      
54      /***
55       * Constructs a new <code>FTPException</code>.
56       * 
57       * @param code  the error code from the FTP server
58       */
59      public FTPException(int code) {
60          super("FTP error code: " + code);
61          this.code = code;
62      }
63  
64  
65      /***
66       * Returns the error code from the FTP server.
67       * 
68       * @return  the error code from the FTP server
69       */
70      public int getReplyCode() {
71          return code;
72      }
73  }