01: /*
02: * Copyright 2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
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,
49: Throwable rootCause) {
50: super (message);
51: this .rootCause = rootCause;
52: }
53:
54: /**
55: * returns the root cause of this exception or null
56: * if no root cause was specified.
57: *
58: * @return the root cause of this exception being thrown
59: */
60: public Throwable getRootCause() {
61: return this.rootCause;
62: }
63:
64: }
|