Specialization of loadresource that works on files exclusively and provides a srcFile attribute for convenience. Unless an encoding is specified, the encoding of the current locale is used.
If the resource content is empty (maybe after processing a filterchain) the property
is not set.
| Attribute | Description | Required | 
|---|---|---|
| srcFile | source file | Yes | 
| property | property to save to | Yes | 
| encoding | encoding to use when loading the file | No | 
| failonerror | Whether to halt the build on failure | No; default true | 
| quiet | Do not display a diagnostic message (unless Apache Ant has been invoked with
      the -verbose or -debug switches) or modify the exit status to
      reflect an error. Setting this to trueimplies setting failonerror to false. Since Ant 1.7.0. | No; default false | 
The LoadFile task supports nested FilterChains.
Load file message.txt into property message;
an <echo> can print this.
<loadfile property="message"
          srcFile="message.txt"/>
The above is identical to
<loadresource property="message">
    <file file="message.txt"/>
</loadresource>
Load a file using the Latin-1 encoding
<loadfile property="encoded-file"
          srcFile="loadfile.xml"
          encoding="ISO-8859-1"/>
Load a file, don't fail if it is missing (a message is printed, though)
<loadfile property="optional.value"
          srcFile="optional.txt"
          failonerror="false"/>
Load a property which can be used as a parameter for another task (in this
case mail), merging lines to ensure this happens.
<loadfile property="mail.recipients"
          srcFile="recipientlist.txt">
    <filterchain>
        <striplinebreaks/>
    </filterchain>
</loadfile>
Load an XML file into a property, expanding all properties declared in the file in the process.
<loadfile property="system.configuration.xml"
          srcFile="configuration.xml">
    <filterchain>
        <expandproperties/>
    </filterchain>
</loadfile>