Ant Task check if a file exists
来源:互联网 发布:老死什么感受知乎 编辑:程序博客网 时间:2024/06/16 09:22
This is to remember what I learned when I customize Liferay SDK plugins.
In my case, I need to read a properties file and then get those values to create portlet. The first thing, I have to validate if the file exists in the folder.
1. Fail Task
<fail message="Files are missing."><condition><not><resourcecount count="1"> <fileset dir="." includes="${properties.file.name}"/></resourcecount></not></condition></fail>http://ant.apache.org/manual/Tasks/fail.html The link shows more examples of Fail task.
2. Available Task
<!-- If the file doesn't exist, it will display the message. --><if><not><available file="${properties.file.name}"/></not><then><echo message="${properties.file.name} doesn't exist." /></then></if>https://ant.apache.org/manual/Tasks/available.html The link shows more examples of Fail task.
- Ant Task check if a file exists
- Makefile – Check if a file exists using wildcard function
- confirm if a file exists
- Check if a table or field exists in a database
- Check if a File is in Internet Explorers Cache
- Fastest way to check if a file exist using standard C++
- Java – Check if key exists in HashMap
- Python – Check if key exists in dictionary
- check if filed exists in all tables in current DB
- Check if a string value is numeric
- Check if a linked list is palindrome
- [Apache --- Ant]DIY Ant Task II --- a little more difficult
- Check for a case sensitive file system
- Have Vim check automatically if the file has changed externally
- Q2.7 Check if a list is a palindrome
- LoadRunner报这个错:invalid application path!please check if application exists
- Class file collision: A resource exists with a different case:
- Check if a given Binary Tree is SumTree
- android学习第二课(布局管理)
- 动态加载dll,扩展系统功能
- Fedora安装android开发环境
- 硬盘安装XUBUNTU
- SDL及扩展库在ARM-Linux 完整移植
- Ant Task check if a file exists
- git 获取分支代码
- CentOS6.3 安装gcc及简单使用
- jqGrid 属性、事件全集
- 关于js禁用右键菜单
- ie内核语句执行顺序
- Use Case Template
- c语言之数组 sizeof strlen
- javassist使用实例