Conditions

These are the nested elements that can be used as conditions in the <condition> and <waitfor> tasks.

not

The <not> element expects exactly one other condition to be nested into this element, negating the result of the condition. It doesn't have any attributes and accepts all nested elements of the condition task as nested elements as well.

and

The <and> element doesn't have any attributes and accepts an arbitrary number of conditions as nested elements - all nested elements of the condition task are supported. This condition is true if all of its contained conditions are, conditions will be evaluated in the order they have been specified in the build file.

The <and> condition has the same shortcut semantics as the Java && operator, as soon as one of the nested conditions is false, no other condition will be evaluated.

or

The <or> element doesn't have any attributes and accepts an arbitrary number of conditions as nested elements - all nested elements of the condition task are supported. This condition is true if at least one of its contained conditions is, conditions will be evaluated in the order they have been specified in the build file.

The <or> condition has the same shortcut semantics as the Java || operator, as soon as one of the nested conditions is true, no other condition will be evaluated.

available

This condition is identical to the Available task, all attributes and nested elements of that task are supported, the property and value attributes are redundant and will be ignored.

uptodate

This condition is identical to the Uptodate task, all attributes and nested elements of that task are supported, the property and value attributes are redundant and will be ignored.

os

Test whether the current operating system is of a given type. Each defined attribute is tested and the result is true only if all the tests succeed.

Attribute Description Required
family The name of the operating system family to expect. No
name The name of the operating system to expect. No
arch The architecture of the operating system to expect. No
version The version of the operating system to expect. No

Supported values for the family attribute are:

equals

Tests whether the two given Strings are identical

Attribute Description Required
arg1 First string to test. Yes
arg2 Second string to test. Yes

isset

Test whether a given property has been set in this project.

Attribute Description Required
property The name of the property to test. Yes

checksum

This condition is identical to the Checksum task, all attributes and nested elements of that task are supported, the property and overwrite attributes are redundant and will be ignored.

http

The http condition checks for a valid response from a web server of the specified url.

Attribute Description Required
url The full URL of the page to request. The web server must return a status code of <500.. Yes.

socket

The socket condition checks for the existence of a TCP/IP listener at the specified host and port.

Attribute Description Required
server The DNS name or IP address of the server. Yes.
port The port number to connect to. Yes.

Copyright © 2001 Apache Software Foundation. All rights Reserved.