Changeset 1685
- Timestamp:
- 2008-03-09 14:13:40 (7 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/handlers/PropertiesLoader.java
r1683 r1685 26 26 import java.util.Properties; 27 27 28 import net.fckeditor.tool.Utils; 29 28 30 import org.slf4j.Logger; 29 31 import org.slf4j.LoggerFactory; … … 33 35 * The main default file is 'default.properties' in the deepth of the classpath and should be 34 36 * untouched. If there is a file named 'fckeditor.properties' in the root of the classpath, it will 35 * be loaded. Values which are loaded before, will be overwritten. 37 * be loaded. Values which are loaded before, will be overwritten.<br> 38 * If you won't use an extra properties file to adjust the defaults, you can use 39 * {@link #setProperty(String, String)} instead. 36 40 * 37 41 * @version $Id$ … … 66 70 } 67 71 72 /** 73 * Getter for a property of 'key'. 74 * 75 * @param key 76 * the propery key 77 * @return the value in this property list with the specified key value. 78 * @see Properties#getProperty(String) 79 */ 68 80 public static String getProperty(final String key) { 69 81 return properties.getProperty(key); 70 82 } 83 84 /** 85 * Setter for a property. If the property already exists, the value will be overwritten.<br> 86 * Hint: This method is intended for an alternative way to set user defaults programmatically 87 * instead of using the 'fckeditor.properties'. It should never used inside FCKeditor.Java !!! 88 * 89 * @param key 90 * key the propery key 91 * @param value 92 * @throws IllegalArgumentException 93 * if 'key' is empty. 94 * @see Properties#setProperty(String, String) 95 */ 96 public static void setProperty(final String key, final String value) { 97 if (Utils.isEmpty(key)) 98 new IllegalArgumentException("The 'key' of a property schouldn't be null!"); 99 properties.setProperty(key, value); 100 } 71 101 }