KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > uitags > util > PropertiesLoadingException


1 /**
2  * Nov 12, 2004
3  *
4  * Copyright 2004 uitags
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package net.sf.uitags.util;
19
20
21 /**
22  * Thrown to indicate that a properties file could not be loaded.
23  *
24  * @author jonni
25  * @version $Id: PropertiesLoadingException.java,v 1.2 2006/07/02 03:02:51 hgani Exp $
26  */

27 public final class PropertiesLoadingException extends RuntimeException JavaDoc {
28   /**
29    * Serial Version UID.
30    */

31   private static final long serialVersionUID = 52L;
32
33   ////////////////////////////
34
////////// Fields //////////
35
////////////////////////////
36

37   /**
38    * The name of the file which could not be loaded
39    */

40   private String JavaDoc filename;
41
42
43
44   //////////////////////////////////
45
////////// Constructors //////////
46
//////////////////////////////////
47

48   /**
49    * See {@link RuntimeException#RuntimeException()}.
50    */

51   public PropertiesLoadingException() {
52     super();
53   }
54
55   /**
56    * See {@link RuntimeException#RuntimeException(java.lang.String)}.
57    *
58    * @param message the detail message
59    */

60   public PropertiesLoadingException(String JavaDoc message) {
61     super(message);
62   }
63
64   /**
65    * See {@link RuntimeException#RuntimeException(java.lang.Throwable)}.
66    *
67    * @param cause the cause
68    */

69   public PropertiesLoadingException(Throwable JavaDoc cause) {
70     super(cause);
71   }
72
73   /**
74    * See
75    * {@link RuntimeException#RuntimeException(java.lang.String, java.lang.Throwable)}.
76    *
77    * @param message the detail message
78    * @param cause the cause
79    */

80   public PropertiesLoadingException(String JavaDoc message, Throwable JavaDoc cause) {
81     super(message, cause);
82   }
83
84   /**
85    * Creates an instance, setting the cause and the name of the file
86    * which could not be loaded.
87    *
88    * @param cause the cause
89    * @param filename the name of the file which could not be loaded
90    */

91   public PropertiesLoadingException(Throwable JavaDoc cause, String JavaDoc filename) {
92     super("Failed to load '" + filename + "'.", cause);
93     this.filename = filename;
94   }
95
96
97
98   /////////////////////////////
99
////////// Methods //////////
100
/////////////////////////////
101

102   /**
103    * Returns the name of the file which could not be loaded.
104    *
105    * @return the name of the file which could not be loaded
106    */

107   public String JavaDoc getFilename() {
108     return this.filename;
109   }
110 }
111
Popular Tags