diff --git a/WHATSNEW b/WHATSNEW
index c8ded0296..2f4ce1572 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -56,6 +56,8 @@ Other changes:
* Add prefix attribute to loadproperties task.
+ * Add resource attribute to length task.
+
Changes from Ant 1.8.0RC1 TO Ant 1.8.0
======================================
diff --git a/docs/manual/CoreTasks/length.html b/docs/manual/CoreTasks/length.html
index e06499dad..e8009f141 100644
--- a/docs/manual/CoreTasks/length.html
+++ b/docs/manual/CoreTasks/length.html
@@ -47,9 +47,16 @@
file |
Single file whose length to report. |
- One of these,
+ | One of these,
or one or more nested filesets |
+
+ resource |
+ Single resource whose length to report (using extended
+ properties handling).
+ Since Ant 1.8.1
+ |
+
string |
The string whose length to report. |
diff --git a/src/main/org/apache/tools/ant/taskdefs/Length.java b/src/main/org/apache/tools/ant/taskdefs/Length.java
index 37c6b7935..644843147 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Length.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Length.java
@@ -67,6 +67,14 @@ public class Length extends Task implements Condition {
this.property = property;
}
+ /**
+ * Set the single resource for this task.
+ * @param resource the Resource whose length to retrieve.
+ */
+ public synchronized void setResource(Resource resource) {
+ add(resource);
+ }
+
/**
* Set the single file for this task.
* @param file the File
whose length to retrieve.
diff --git a/src/tests/antunit/taskdefs/length-test.xml b/src/tests/antunit/taskdefs/length-test.xml
index 432706406..acd5310bb 100644
--- a/src/tests/antunit/taskdefs/length-test.xml
+++ b/src/tests/antunit/taskdefs/length-test.xml
@@ -230,4 +230,11 @@
+
+
+
+
+
+
+