从URL获取文件列表
问题描述:
我想以某种方式实现自动化,让我的Netbeans Daily构建可用。从URL获取文件列表
基本上如下:从http://bits.netbeans.org/download/trunk/nightly/latest/zip/
我
- 获取文件列表一个能够做2和3的蚂蚁脚本。我需要弄清楚如何做第一个。见下:
<?xml version="1.0" encoding="UTF-8"?> <project name="Netbeans Daily Build" basedir="."> <description>Updates the daily build</description> <property name="zip.name" value="netbeans-6.9.1-201007282301-ml-javase.zip"/> <property name="dist" value="Z:/Program Files/Netbeans 7.0/"/> <property name="zip.url" value="http://bits.netbeans.org/download/trunk/nightly/latest/zip/"/> <fileset id="ant-contrib-jar" dir="./"> <include name="ant-contrib-*.jar" /> </fileset> <pathconvert property="ant-contrib-jar" refid="ant-contrib-jar" pathsep="," /> <basename property="ant-contrib-filename" file="${ant-contrib-jar}"/> <property name="ant-contrib-loc" value="./${ant-contrib-filename}"/> <available file="${ant-contrib-loc}" property="ant-contrib.present"/> <fail unless="ant-contrib.present" message="The ant-contrib jar doesn't exist at: ${ant-contrib-loc}, can't build. Check your settings!" /> <taskdef resource="net/sf/antcontrib/antcontrib.properties"> <classpath> <pathelement location="${ant-contrib-loc}"/> </classpath> </taskdef> <!--Delete old copies of platforms--> <delete> <fileset dir="${dist}" includes="**/*.zip" excludes="${zip.name}"/> </delete> <available file="${zip.url}${zip.name}" property="file.exists"/> <if> <not> <isset property="file.exists"/> </not> <then> <get src="${zip.url}${zip.name}" dest="./" skipexisting="true" verbose="true"/> <!--Only overwrite if newer <unzip src="${dist}/${zip.name}" dest="${dist}" overwrite="false"/>--> </then> </if> </project>
我需要找出正确的文件名下载。 在批处理文件(无蚂蚁)中执行所有操作也是可以接受的。
在此先感谢!
这就要求我使用它,以比手动下载再之前编译IDE以及。我只是用一个自动化的手动过程来取代手动过程。 – javydreamercsw 2010-12-01 20:23:30