[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

File Validation Checks with ANT

Posted on 2006-06-25
3
Medium Priority
?
258 Views
Last Modified: 2010-05-18
Hey,

I'm trying to test for empty files - ie files of 0 k size, and also trying to test for certain characters in a filename -  ie pattern matching.

I understand that ANT isn't really intended for these kind of tasks - but I'm hoping that there might be a way,


thanks
0
Comment
Question by:RichardStarkey
1 Comment
 
LVL 15

Accepted Solution

by:
bpmurray earned 1000 total points
ID: 16982953
You can use fileset. For example, to include all the files that have the extension ".txt" and to exclude those that start with an "X" (but not "x") and that have a size greator than zero ...

<fileset dir="/foo/bar">
  <patternset>
      <include name="**/*.txt" />
      <exclude name="**/X*.*" />
  </patternset>
  <size value="0" units="K" when="equal"/>
</fileset>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question