1 15 16 package org.apache.ojb.tools.mapping.reversedb2; 17 18 22 public class ExtendedProperties extends java.util.Properties 23 { 24 25 private String strFilename; 26 27 28 public ExtendedProperties(String pstrFilename) 29 { 30 this.strFilename = pstrFilename; 31 try 32 { 33 load(new java.io.FileInputStream (System.getProperty("user.home") + 34 System.getProperty("file.separator") + strFilename)); 35 } 36 catch (java.io.IOException ioex) 37 { 38 } 39 } 40 41 public synchronized void storeProperties(String comment) 42 { 43 try 44 { 45 store(new java.io.FileOutputStream (System.getProperty("user.home") + 46 System.getProperty("file.separator") + strFilename), comment); 47 } 48 catch (Throwable t) 49 { 50 } 52 } 53 54 public synchronized void clear() 55 { 56 super.clear(); 57 } 58 59 public synchronized Object put(Object key, Object value) 60 { 61 return super.put(key, value); 62 } 63 64 public synchronized void putAll(java.util.Map t) 65 { 66 super.putAll(t); 67 } 68 69 public synchronized Object remove(Object key) 70 { 71 return super.remove(key); 72 } 73 74 public synchronized Object setProperty(String key, String 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 |