Previous Topic  Next Topic 


This API provides the necessary functions for reading, manipulating and writing common properties files.  A properties file follows the standard convention for Java properties files, but it basically matches an almost universal format for simple properties within a file.

Supported Platforms



See options


-array <arrayName> (required)

The name of an array to store the values in.

-do (required)

Specifies the action the API should take.  Possible values are:


Add a line to the given array that should be written to the properties file as-is.


Return a string of data that will be written to a file if written.  This data is the current contents of the properties file.


Return a list of keys in the properties array.


Read a given properties file into the array.


Set the value of a given key to a value.  If the key already exists, it will be overwritten, and when it is saved to a file, it will replace the original line that set the key in the same place within the file.


Unset the value of a given key.  This will remove the key from the array as well as delete any reference to the value when the file is written out.


Write the property array to a file.


If the do action is read or write, this property specifies the name of the file to read from or write to.


If the do action is set or unset, this property specifies the key in the array to operate on.


If the do action is append, this property specifies a line (or multiline) string to append directly to the given array.


Specifies the separator character to use between keys and values.  The default is =.


If the do action is set or unset, this property specifies the value to set for the given key.


The following example shows a sample properties file and how the API uses it.

## Sample .properties file.

## Set foo


## Set bar


::InstallAPI::PropertyFileAPI -do read -array props

::InstallAPI::PropertyFileAPI -do set -array props -key foo -value "NEW FOO"

::InstallAPI::PropertyFileAPI -do append -array props -line "\n## New value"

::InstallAPI::PropertyFileAPI -do set -array props -key newvalue -value "NEW VALUE"

The new properties file will look like this

## Sample .properties file.

## Set foo


## Set bar


## New value

newvalue=NEW VALUE