📜  Apache Ant长度任务

📅  最后修改于: 2020-12-26 14:00:42             🧑  作者: Mango

Apache Ant长度任务

此任务用于设置任何字符串或文件的length属性。它也可以用于显示属性值或作为条件。

它具有以下提供的各种属性。

Apache Ant长度任务属性

Attribute Description Required
Task Condition
property It is used to set length. No Ignored
mode It is used with file length mode. No Ignored
file Single file whose length to report. One of these, or one or more nested filesets.
resource Single resource whose length to report.
string The string whose length to report.
trim Trim while working on string No
length Comparison length. Ignored Yes
when Comparison type: equal, eq, greater etc. Ignored No

让我们看一些我们也设置字符串和文件长度的示例。

Apache Ant Length任务示例

存储字符串长度:

    
    
        
        
    

存储文件长度:

    
    
        
    

将文件路径及其长度存储到length属性中。