B.8 AvailableTask

Available Task tests if a resource/file is set and sets a certain property to a certain value if it exists.

Here, AvailableTask first checks for the existence of either file or directory named test.txt in /tmp. Then, it checks for the directory foo in /home and then for the file or directory bar in /home/foo. If /tmp/test.txt is found, the property test_txt_exists is set to "Yes", if /home/foo is found and a directory, properties.yetanother is set to "true" (default). If /home/foo/bar exists, AvailableTask will set foo.bar to "Well, yes". And last it checks if extension foo is loaded, so the property foo.ext.loaded is set to "true" (default).

NB: the Available task can also be used as a condition, see conditions.

Table B.10: Attributes

NameTypeDescriptionDefaultRequired
property String Name of the property that is to be set.n/aYes
value String The value the property is to be set to. "true" No
file String File/directory to check existence.n/aYes (or resource or extension)
resource String Path of the resource to look for.n/aYes (or file or extension)
extension String Name of the extension to look for.n/aYes (or file or resource)
type String (file|dir) Determines if AvailableTask should look for a file or a directory at the position set by file. If empty, it checks for either file or directory. n/aNo
filepath String The path to use when looking up file. n/aNo
followSymlinks Boolean Whether to dereference symbolic links when looking up file. false No

B.8.1 Examples

<available file="/tmp/test.txt" property="test_txt_exists" value="Yes"/>

<available file="/home/foo" type="dir" property="properties.yetanother" />

<available file="/home/foo/bar" property="foo.bar" value="Well, yes" />