?
Solved

File Validation Checks with ANT

Posted on 2006-06-25
3
Medium Priority
?
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 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