1 43 44 package org.jfree.base.config; 45 46 import java.util.Enumeration ; 47 import java.util.Vector ; 48 49 54 public class SystemPropertyConfiguration extends HierarchicalConfiguration { 55 56 61 public SystemPropertyConfiguration() { 62 } 63 64 70 public void setConfigProperty(final String key, final String value) { 71 throw new UnsupportedOperationException ("The SystemPropertyConfiguration is readOnly"); 72 } 73 74 86 public String getConfigProperty(final String key, final String defaultValue) { 87 try { 88 final String value = System.getProperty(key); 89 if (value != null) { 90 return value; 91 } 92 } 93 catch (SecurityException se) { 94 } 96 return super.getConfigProperty(key, defaultValue); 97 } 98 99 106 public boolean isLocallyDefined(final String key) { 107 try { 108 return System.getProperties().containsKey(key); 109 } 110 catch (SecurityException se) { 111 return false; 112 } 113 } 114 115 122 public Enumeration getConfigProperties() { 123 try { 124 return System.getProperties().keys(); 125 } 126 catch (SecurityException se) { 127 return new Vector ().elements(); 129 } 130 } 131 } 132 | Popular Tags |