## 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:

- windows (for all versions of Microsoft Windows)
- dos (for all Microsoft DOS based operating systems including Microsoft Windows and OS/2)
- mac (for all Apple Macintosh systems)
- unix (for all Unix and Unix-like operating systems)
- netware (for Novell NetWare)
- os/2 (for OS/2)

#### equals

Tests whether the two given Strings are identical

Attribute | Description | Required
arg1 | First string to test. | Yes
arg2 | Second string to test. | Yes
casesensitive | Perform a case sensitive comparision. Default is true. | No
trim | Trim whitespace from arguments before comparing them. Default is false. | No

#### 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.

#### filesmatch

Test two files for matching. Both files must exist first. This test does a byte for byte comparision, so test time scales with byte size. NB: if the files are different sizes or the filenames match the slower test is shortcutted.

Attribute | Description | Required
file1 | First file to test | Yes.
file2 | Second file to test | Yes.

Copyright © 2001-2002 Apache Software Foundation. All rights Reserved.