Ant用のRESTfulhttpclientが必要です。
contrib関連のタスクはもう機能していないようです。
Commons-HTTPClientとAntをブリッジした人はまだいませんか?
Ant用のRESTfulhttpclientが必要です。
contrib関連のタスクはもう機能していないようです。
Commons-HTTPClientとAntをブリッジした人はまだいませんか?
Antexecタスクとcurlを使用してみてください。
次のマクロ定義を使用して、ANT から POST ファイルへの CURL を使用しました。
<pathconvert property="curl.path" targetos="windows">
<path location="${lib.dir}/curl/curl.exe"/>
</pathconvert>
<macrodef name="post-file" description="Use Curl to post the file to the WEBDAV path">
<attribute name="file"/>
<attribute name="url" />
<attribute name="username" default="${username}" />
<attribute name="password" default="${password}" />
<sequential>
<echo message="Using CURL to upload @{file} to @{url}" />
<!--Execute curl to post the file to the URL -->
<exec executable="${curl.path}">
<arg value='-L'/>
<arg value='-k'/>
<arg value='-f'/>
<arg value='-s'/>
<arg value="--anyauth"/>
<arg value="-u"/>
<arg value="@{username}:@{password}"/>
<arg value="-T" />
<arg value='"@{file}"' />
<arg value='@{url}'/>
</exec>
</sequential>
</macrodef>
次のようにマクロ定義を実行します。
<target name="test-upload">
<post-file file="${file}"
url="${url}"
username="${username}"
password="${password}" />
</target>
このプロジェクトhttp://fikin-ant-tasks.sourceforge.net/を見つけました。
ファイルの最終更新は 2007-03-12 なので、品質が少し心配です...
ここのユーザーはいますか?
Antelopeには http 投稿タスクがありますが、基本認証をサポートしていないようです。:/