Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ResourcesException |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: ResourcesException.java 348357 2005-11-23 03:59:22Z niallp $ | |
3 | * $Revision: 348357 $ | |
4 | * $Date: 2005-11-23 03:59:22 +0000 (Wed, 23 Nov 2005) $ | |
5 | * | |
6 | * ==================================================================== | |
7 | * | |
8 | * Copyright 2003-2005 The Apache Software Foundation | |
9 | * | |
10 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
11 | * you may not use this file except in compliance with the License. | |
12 | * You may obtain a copy of the License at | |
13 | * | |
14 | * http://www.apache.org/licenses/LICENSE-2.0 | |
15 | * | |
16 | * Unless required by applicable law or agreed to in writing, software | |
17 | * distributed under the License is distributed on an "AS IS" BASIS, | |
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
19 | * See the License for the specific language governing permissions and | |
20 | * limitations under the License. | |
21 | * | |
22 | */ | |
23 | ||
24 | package org.apache.commons.resources; | |
25 | ||
26 | import java.io.Serializable; | |
27 | ||
28 | /** | |
29 | * <p>This class is a general purpose wrapper exception for problems | |
30 | * pertaining to Resources.</p> | |
31 | */ | |
32 | public class ResourcesException extends RuntimeException implements Serializable { | |
33 | ||
34 | /** Exception message */ | |
35 | 0 | private String message = ""; |
36 | ||
37 | /** Cause of the exception */ | |
38 | 0 | private Throwable rootCause = null; |
39 | ||
40 | /** | |
41 | * Construct an Exception with the specified message. | |
42 | * @param message The message. | |
43 | */ | |
44 | public ResourcesException(String message) { | |
45 | 0 | this(message, null); |
46 | 0 | } |
47 | ||
48 | /** | |
49 | * Construct an Exception with the specified cause. | |
50 | * @param rootCause Cause of the exception. | |
51 | */ | |
52 | 0 | public ResourcesException(Throwable rootCause) { |
53 | 0 | this.message = rootCause.getMessage(); |
54 | 0 | this.rootCause = rootCause; |
55 | 0 | } |
56 | ||
57 | /** | |
58 | * Construct an Exception with the specified message. | |
59 | * and cause. | |
60 | * @param message The message. | |
61 | * @param rootCause Cause of the exception. | |
62 | */ | |
63 | 0 | public ResourcesException(String message, Throwable rootCause) { |
64 | 0 | this.message = message; |
65 | 0 | this.rootCause = rootCause; |
66 | 0 | } |
67 | ||
68 | /** | |
69 | * Return the message. | |
70 | * @return The message. | |
71 | */ | |
72 | public String getMessage() { | |
73 | 0 | return message; |
74 | } | |
75 | ||
76 | /** | |
77 | * Return the cause. | |
78 | * @return The cause of the Exception. | |
79 | */ | |
80 | public Throwable getRootCause() { | |
81 | 0 | return rootCause; |
82 | } | |
83 | } |