Load a text file into a single property. Unless an encoding is specified, the encoding of the current locale is used.
テキストファイルを読み込み、一つのプロパティに設定します。 エンコーディングは指定されない限り、 現在のロケールが使われます。
| 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" |
| 属性 | 説明 | 必須 |
| srcFile | ソースファイル | Yes |
| property | 設定するプロパティ名 | Yes |
| encoding | ファイルロード時に使うエンコーディング | No |
| failonerror | 失敗時にビルドを停止させるか | No, デフォルト "true" |
The LoadFile task supports nested FilterChains.
LoadFile タスクは 複数の FilterChainをネストすることができます。
<loadfile property="message"
srcFile="message.txt" />
Load file message.txt into property "message"; an <echo> can print this.
message.txt ファイルをロードし、プロパティ "message" に設定します; <echo> により、これを出力することができます。
<loadfile property="encoded-file"
srcFile="loadfile.xml"
encoding="ISO-8859-1" />
Load a file using the latin-1 encoding
ファイルを latin-1 エンコーディングを用いてロードします。
<loadfile
property="optional.value"
srcFile="optional.txt"
failonerror="false" />
Load a file, don't fail if it is missing (a message is printed, though)
ファイルをロードしようとして、 ファイルが無くても、失敗しません。 (けれども、メッセージは出力されます。)
<loadfile
property="mail.recipients"
srcFile="recipientlist.txt">
<filterchain>
<striplinebreaks/>
</filterchain>
</loadfile>
Load a property which can be used as a parameter for another task (in this case mail), merging lines to ensure this happens.
タスクが処理できるように行をマージして、 他のタスク(この例ではMailです) のパラメータとして使われるプロパティをロードします。
<loadfile
property="system.configuration.xml"
srcFile="configuration.xml">
<filterchain>
<expandproperties/>
</filterchain>
</loadfile>
Load an XML file into a property, expanding all properties declared in the file in the process.
XML ファイルをプロパティとしてロードし、 ファイル中で宣言された全てのプロパティをプロセスに展開します。
Copyright © 2001-2002,2004 The Apache Software Foundation. All rights Reserved.