* @param name The name of the property in the properties file
* @param value The value of the property in the properties file */
public static void setPropertyValue(String resource, String name, String value) {
if (resource == null || resource.length() <= 0) return;
if (name == null || name.length() <= 0) return;
FlexibleProperties properties = (FlexibleProperties) resourceCache.get(resource);
if (properties == null) {
try {
URL url = UtilURL.fromResource(resource);
if (url == null) return;
properties = FlexibleProperties.makeFlexibleProperties(url);
resourceCache.put(resource, properties);
} catch (MissingResourceException e) {
Debug.log(e.getMessage(), module);
}
}
if (properties == null) {
Debug.log("[UtilProperties.setPropertyValue] could not find resource: " + resource, module);
return;
}
try {
properties.setProperty(name, value);
FileOutputStream propFile = new FileOutputStream(resource);
properties.store(propFile,
"##############################################################################\n"
+"# Licensed to the Apache Software Foundation (ASF) under one \n"
+"# or more contributor license agreements. See the NOTICE file \n"
+"# distributed with this work for additional information \n"
+"# regarding copyright ownership. The ASF licenses this file \n"