Revision 6030
Added by ben leinfelder over 13 years ago
src/edu/ucsb/nceas/metacat/properties/PropertyService.java | ||
---|---|---|
242 | 242 |
properties.setProperty(propertyName, newValue); |
243 | 243 |
properties.persistProperties(); |
244 | 244 |
} |
245 |
|
|
246 |
/** |
|
247 |
* Utility method to add a property value both in memory and to the |
|
248 |
* properties file |
|
249 |
* |
|
250 |
* @param propertyName |
|
251 |
* the name of the property to add |
|
252 |
* @param newValue |
|
253 |
* the value for the property |
|
254 |
*/ |
|
255 |
public static void addProperty(String propertyName, String value) |
|
256 |
throws GeneralPropertyException { |
|
257 |
properties.addProperty(propertyName, value); |
|
258 |
properties.persistProperties(); |
|
259 |
} |
|
245 | 260 |
|
246 | 261 |
/** |
247 | 262 |
* Utility method to set a property value in memory. This will NOT cause the |
src/edu/ucsb/nceas/metacat/properties/SimpleProperties.java | ||
---|---|---|
140 | 140 |
} |
141 | 141 |
|
142 | 142 |
/** |
143 |
* Utility method to add a property value both in memory and to the |
|
144 |
* properties file |
|
145 |
* |
|
146 |
* @param propertyName |
|
147 |
* the name of the property to add |
|
148 |
* @param newValue |
|
149 |
* the new value for the property |
|
150 |
*/ |
|
151 |
public void addProperty(String propertyName, String value) throws GeneralPropertyException { |
|
152 |
sortedProperties.addProperty(propertyName, value); |
|
153 |
sortedProperties.store(); |
|
154 |
} |
|
155 |
|
|
156 |
/** |
|
143 | 157 |
* Utility method to set a property value both in memory and to the |
144 | 158 |
* properties file |
145 | 159 |
* |
src/edu/ucsb/nceas/metacat/properties/ConfigurableProperties.java | ||
---|---|---|
235 | 235 |
public Map<String, String> getPropertiesByGroup(String groupName) throws PropertyNotFoundException { |
236 | 236 |
return mainProperties.getPropertiesByGroup(groupName); |
237 | 237 |
} |
238 |
|
|
239 |
/** |
|
240 |
* Utility method to add a property value both in memory and to the |
|
241 |
* properties file |
|
242 |
* |
|
243 |
* @param propertyName |
|
244 |
* the name of the property to add |
|
245 |
* @param newValue |
|
246 |
* the value for the property |
|
247 |
*/ |
|
248 |
public void addProperty(String propertyName, String value) throws GeneralPropertyException { |
|
249 |
mainProperties.addProperty(propertyName, value); |
|
250 |
mainProperties.store(); |
|
251 |
} |
|
238 | 252 |
|
239 | 253 |
/** |
240 | 254 |
* Utility method to set a property value both in memory and to the |
src/edu/ucsb/nceas/metacat/properties/PropertiesInterface.java | ||
---|---|---|
61 | 61 |
|
62 | 62 |
public Map<String, String> getPropertiesByGroup(String groupName) throws PropertyNotFoundException; |
63 | 63 |
|
64 |
public void addProperty(String propertyName, String value) throws GeneralPropertyException; |
|
65 |
|
|
64 | 66 |
public void setProperty(String propertyName, String newValue) throws GeneralPropertyException; |
65 | 67 |
|
66 | 68 |
public void setPropertyNoPersist(String propertyName, String newValue) throws GeneralPropertyException; |
Also available in: Unified diff
allow the addition of properties via code