Whatever message this page gives is out now! Go check it out!
setPropertyString(String filePath, String key, Object value, String encoding)Parameter | Required | Type | Description |
filePath | Yes | String | The absolute path of the properties file. |
key | Yes | String | The key to add in the properties file. |
value | No | Any object | The value for the specified key to be added in the properties file. |
encoding | No | String | The encoding of the properties file. The default is UTF-8. If not specified, picks the default encoding. |
<cfscript>
//setPropertyString with key and value
path =GetDirectoryFromPath(GetCurrentTemplatePath()) & "config.properties"
setPropertyString(path,"host","localhost","utf-8");
property1=getPropertyString(path,"host");
if (property1 EQ "localhost") {
writeOutput("Successfully set key");
}
else {
writeOutput("Failed to set key");
}
</cfscript>