1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net.ftp.parser;
17
18 /**
19 * This class encapsulates all errors that may be thrown by
20 * the process of an FTPFileEntryParserFactory creating and
21 * instantiating an FTPFileEntryParser.
22 */
23 public class ParserInitializationException extends RuntimeException {
24
25 /**
26 * Root exception that caused this to be thrown
27 */
28 private final Throwable rootCause;
29
30 /**
31 * Constucts a ParserInitializationException with just a message
32 *
33 * @param message Exception message
34 */
35 public ParserInitializationException(String message) {
36 super(message);
37 this.rootCause = null;
38 }
39
40 /**
41 * Constucts a ParserInitializationException with a message
42 * and a root cause.
43 *
44 * @param message Exception message
45 * @param rootCause root cause throwable that caused
46 * this to be thrown
47 */
48 public ParserInitializationException(String message, Throwable rootCause) {
49 super(message);
50 this.rootCause = rootCause;
51 }
52
53 /**
54 * returns the root cause of this exception or null
55 * if no root cause was specified.
56 *
57 * @return the root cause of this exception being thrown
58 */
59 public Throwable getRootCause() {
60 return this.rootCause;
61 }
62
63 }