fla*_*nze 4 ant zip unzip mapper
很多zip文件都有一个根文件夹,如何解压缩zip文件并删除根文件夹?
我知道有globmapper
:
<unzip dest="${dest.path}">
<fileset dir="${source.path}">
<include name="**/zipfile*.*.zip" />
</fileset>
<mapper>
<globmapper from="rootFolder/*" to="*" />
</mapper>
</unzip>
Run Code Online (Sandbox Code Playgroud)
但是,如果我不知道根文件夹的名称呢?通配符不起作用,例如
<globmapper from="root*Folder/*" to="*" />
Run Code Online (Sandbox Code Playgroud)
有没有办法使用通配符或没有根文件夹进行upack的映射器/函数?
CAu*_*tin 12
实际上有一个专门为这个名为cutdirsmapper的单独的映射器.尝试一下:
<unzip dest="${dest.path}">
<fileset dir="${source.path}">
<include name="**/zipfile*.*.zip" />
</fileset>
<cutdirsmapper dirs="1" />
</unzip>
Run Code Online (Sandbox Code Playgroud)