ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: Using ANT to validate a URL
Date Fri, 24 Jul 2009 17:07:37 GMT
2009/7/24 JĂșlio Cesar Bueno Cotta <juliocbcotta@gmail.com>

> humm..that can help me ..
> just to be sure..
> if the url is www.google.com it is ok..but if the url is
> www.Do_Not_exist.com it is a valid url?


Ran it with the following build.xml

*project>
  <condition property="first">
    <http url="http://google.com"/>
  </condition>

  <condition property="second">
    <http url="http://does_not_exist.com"/>
  </condition>

  <echo>first="${first}" second="${second}"</echo>
</project>
*

Got the following output

*$ ant
Buildfile: build.xml
     [echo] first="true" second="${second}"
*

The http://google.com set the property "first", but the second one
http://does_not_exist.com doesn't set the property "second" (which is why it
printed out ${second}).

Seems to work fine. However, the format must be a vaild URL format which
means you need to include the protocol and possibly the port.

-- 
David Weintraub
qazwart@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message