Hi all,
I have been working on conditional structures and loop structures on existing
workflow managers for a long time. For this purpose I have implemented two
simple examples for if-type and switch-type cases (examples are attached). In
these examples my program is simply downloading a file. If that file does not
exist in the first web address it tries another address. However, I could not
implement a loop structure for that. In the loop case the program should try
the same address until the file exists. Actually I know this is not a
reasonable and useful scenario but I just want to show whether a
conditional-loop scenario can be implemented in Ant.
Can u suggest me anything to implement that example. Any help is appreciated.
Thanks.
Emir Mahmut Bahsi
Research assistant
Dept of Computer Science at LSU
Room 231, Johnston Hall
Louisiana State University
Baton Rouge, LA 70803
[EMAIL PROTECTED]
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
<project name="Emir" default="init" basedir=".">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location=".\ant-contrib\ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<target name="init">
<if>
<http url="http://www.cct.lsu.edu/~embahsi/a.jpg" />
<then>
<get src="http://www.cct.lsu.edu/~embahsi/a.jpg" dest="./myfiles/a.jpg"/>
<echo>File is being downloaded from first resource</echo>
</then>
<else>
<get src="http://www.cct.lsu.edu/~embahsi/b.jpg" dest="./myfiles/b.jpg"/>
<echo>First resource did not work so file is downloaded from alternative source</echo>
</else>
</if>
</target>
</project>
<project name="Emir" default="init" basedir=".">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location=".\ant-contrib\ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<target name="init">
<if>
<http url="http://www.cct.lsu.edu/~embahsi/a.jpg" />
<then>
<get src="http://www.cct.lsu.edu/~embahsi/a.jpg" dest="./myfiles/a.jpg"/>
<echo>File is being downloaded from first resource</echo>
</then>
<elseif>
<http url="http://www.cct.lsu.edu/~embahsi/b.jpg" />
<then>
<get src="http://www.cct.lsu.edu/~embahsi/b.jpg" dest="./myfiles/b.jpg"/>
<echo>First resource did not work so file is downloaded from 2nd alternative source</echo>
</then>
</elseif>
<else>
<get src="http://www.cct.lsu.edu/~embahsi/c.jpg" dest="./myfiles/c.jpg"/>
<echo>1st and 2nd resource did not work so file is downloaded from 3rd alternative source</echo>
</else>
</if>
</target>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]