Ant获取任务超时问题

时间:2013-09-23 17:49:40

标签: ant get task

我有一个返回纯文本的Web服务。我将添加超时,如果服务未设置属性为true。我怎样才能做到这一点?以下是我的代码。

<get src="localhost:8080/order/available" dest="${propertyname}"/>

我得到了:

get不支持“maxtime”属性

1 个答案:

答案 0 :(得分:3)

你可以使用这样的东西。首先下载到文件,然后检查文件是否存在:

<delete file="${testfile}"/>
<get src="localhost:8080/order/available" dest="${testfile}" maxtime="5000" />
<available file="${testfile}"  property="${propertyname}" value="true"/>

编辑:根据doc

,可以在ant 1.8.0或更高版本中使用maxtime属性
相关问题