01: /* Copyright 2002-2005 The Apache Software Foundation
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * 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 {
23:
24: private String strFilename;
25:
26: /** Creates a new instance of ExtendedProperties */
27: public ExtendedProperties(String pstrFilename) {
28: this .strFilename = pstrFilename;
29: try {
30: load(new java.io.FileInputStream(System
31: .getProperty("user.home")
32: + System.getProperty("file.separator")
33: + strFilename));
34: } catch (java.io.IOException ioex) {
35: }
36: }
37:
38: public synchronized void storeProperties(String comment) {
39: try {
40: store(new java.io.FileOutputStream(System
41: .getProperty("user.home")
42: + System.getProperty("file.separator")
43: + strFilename), comment);
44: } catch (Throwable t) {
45: // Report nothing
46: }
47: }
48:
49: public synchronized void clear() {
50: super .clear();
51: }
52:
53: public synchronized Object put(Object key, Object value) {
54: return super .put(key, value);
55: }
56:
57: public synchronized void putAll(java.util.Map t) {
58: super .putAll(t);
59: }
60:
61: public synchronized Object remove(Object key) {
62: return super .remove(key);
63: }
64:
65: public synchronized Object setProperty(String key, String value) {
66: return super .setProperty(key, value);
67: }
68:
69: protected void finalize() {
70: System.out.println(this .getClass().getName() + " finalized");
71: }
72: }
|