ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Cannot delete directories using wildcards
Date Fri, 02 Jun 2006 08:02:45 GMT
>> Just for information:
>> - The 'dir' attribute must be exactly one value, because it is the 
>> root for
>
>Any reason we can't add a runtime test to check if the 
>supplied value is not a directory and if so that an 
>appropriate exception?

As shown in the tutorial [1], using filesets is done like

   FileSet fs = (FileSet)itFSets.next();
   DirectoryScanner ds = fs.getDirectoryScanner(getProject());         
   String[] includedFiles = ds.getIncludedFiles();

This results in AbstractFileSet.getDirectoryScanner(Project) [2]:
   ...
   if (dir == null) {
       throw new BuildException("No directory specified for " +
getDataTypeName() + ".");
   }
   if (!dir.exists()) {
       throw new BuildException(dir.getAbsolutePath() + " not found.");
   }
   if (!dir.isDirectory()) {
       throw new BuildException(dir.getAbsolutePath() + " is not a
directory.");
   }

What additional exceptions do you want?



Jan


[1]
http://svn.apache.org/repos/asf/ant/core/trunk/docs/manual/tutorial-task
s-filesets-properties.html
    http://ant.apache.org/manual/tutorial-tasks-filesets-properties.html
[2]
http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools
/ant/types/AbstractFileSet.java

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message