From 158906d666a9161639e657ad81ae2c8bead5e5c5 Mon Sep 17 00:00:00 2001
From: Steve Loughran These are the nested elements that can be used as conditions in the
- This condition is identical to the 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.Conditions
<condition>
and
+<condition>
and
<waitfor>
tasks.not
@@ -143,7 +143,7 @@ the tests succeed.
checksum
-
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 + | The full URL of the page to request. The web server must return a status code of <500.. | Yes. |
Attribute | Description | Required |
server | The DNS name or IP address of the server. | Yes. |
port | The port number to connect to. | Yes. | @@ -187,24 +187,25 @@ TCP/IP listener at the specified host and port.
Test two files for matching. Both files must exist first. +
Test two files for matching. Nonexistence of either file results in "false". 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. - +byte size. NB: if the files are different sizes , one of them is missing +or the filenames match the answer is so obvious the detailed test is omitted. + +
Attribute | Description | Required |
file1 | First file to test | Yes. |
file2 | Second file to test | Yes. | diff --git a/src/main/org/apache/tools/ant/taskdefs/condition/FilesMatch.java b/src/main/org/apache/tools/ant/taskdefs/condition/FilesMatch.java index 245205252..58b28222f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/condition/FilesMatch.java +++ b/src/main/org/apache/tools/ant/taskdefs/condition/FilesMatch.java @@ -81,7 +81,7 @@ public class FilesMatch implements Condition { private FileUtils fu = FileUtils.newFileUtils(); /** - * Sets the File1 attribute + * Sets the File1 attribute * * @param file1 The new File1 value */ @@ -112,13 +112,7 @@ public class FilesMatch implements Condition { if (file1 == null || file2 == null) { throw new BuildException("both file1 and file2 are required in fileequals"); } - if (!file1.exists()) { - throw new BuildException("file " + file1 + " not found"); - } - if (!file2.exists()) { - throw new BuildException("file " + file2 + " not found"); - } - + //#now match the files boolean matches=false; try {