KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > tools > mapping > reversedb2 > ExtendedProperties


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

15
16 package org.apache.ojb.tools.mapping.reversedb2;
17
18 /**
19  *
20  * @author Administrator
21  */

22 public class ExtendedProperties extends java.util.Properties JavaDoc
23 {
24     
25     private String JavaDoc strFilename;
26     
27     /** Creates a new instance of ExtendedProperties */
28     public ExtendedProperties(String JavaDoc pstrFilename)
29     {
30         this.strFilename = pstrFilename;
31       try
32       {
33         load(new java.io.FileInputStream JavaDoc(System.getProperty("user.home") +
34             System.getProperty("file.separator") + strFilename));
35       }
36       catch (java.io.IOException JavaDoc ioex)
37       {
38       }
39     }
40     
41     public synchronized void storeProperties(String JavaDoc comment)
42     {
43         try
44         {
45             store(new java.io.FileOutputStream JavaDoc(System.getProperty("user.home") +
46                 System.getProperty("file.separator") + strFilename), comment);
47         }
48         catch (Throwable JavaDoc t)
49         {
50             // Report nothing
51
}
52     }
53     
54     public synchronized void clear()
55     {
56         super.clear();
57     }
58     
59     public synchronized Object JavaDoc put(Object JavaDoc key, Object JavaDoc value)
60     {
61         return super.put(key, value);
62     }
63     
64     public synchronized void putAll(java.util.Map JavaDoc t)
65     {
66         super.putAll(t);
67     }
68     
69     public synchronized Object JavaDoc remove(Object JavaDoc key)
70     {
71         return super.remove(key);
72     }
73     
74     public synchronized Object JavaDoc setProperty(String JavaDoc key, String JavaDoc value)
75     {
76         return super.setProperty(key,value);
77     }
78     
79     protected void finalize()
80     {
81         System.out.println(this.getClass().getName() + " finalized");
82     }
83 }
84
Popular Tags