- Ant Tasks - Discussion
- Ant Tasks - Useful Resources
- Ant Tasks - Quick Guide
- ANT Tasks -JAR
- ANT Tasks - Zip
- ANT Tasks - WAR
- ANT Tasks - Sleep
- ANT Tasks - Move
- ANT Tasks - MkDir
- ANT Tasks - LoadFile
- ANT Tasks - Length
- ANT Tasks - Javac
- ANT Tasks - Java
- ANT Tasks - Import
- ANT Tasks - Fail
- ANT Tasks - EAR
- ANT Tasks - Delete
- ANT Tasks - Copy
- ANT Tasks - Condition
- ANT Tasks - Concat
- ANT Tasks - Chmod
- ANT Tasks - GUnzip
- ANT Tasks - GZip
- ANT Tasks - BaseName
- ANT Tasks - Environment Setup
- ANT Tasks - Introduction
- ANT Tasks - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Apache Ant Tasks - Length
Description
Length task display or set a property containing length information for a string, a file, or one or more nested resource collections. It can also be used as a condition.
Properties
Sr.No | Attributes & Description |
---|---|
1 | Property The property to set. |
2 | Mode File length mode; when all the resulting value is the sum of all included resources lengths; when each the task outputs the absolute path and length of each included resource, one per pne. |
3 | File Single file whose length to report. |
4 | Resource Single resource whose length to report (using extended properties handpng). |
5 | String The string whose length to report. |
6 | Trim Whether to trim when operating on a string. |
7 | Length Comparison length. |
8 | When Comparison type: equal, eq, greater, gt, less, lt, ge (greater or equal), ne (not equal), le (less or equal). |
Example
Usage
Create build.xml with the following content −
<?xml version="1.0"?> <project name="TutorialPoint" default="info"> <length string="tutorialspoint" property="text.size"/> <target name="info"> <echo message="${text.size}"/> </target> </project>
Output
Running Ant on the above build file produces the following output −
F: utorialspointant>ant Buildfile: F: utorialspointantuild.xml info: [echo] 14 BUILD SUCCESSFUL Total time: 0 secondsAdvertisements