From b0f1f9cab707a5227a69d33ed613c5c988b00d4b Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 14 Mar 2001 12:48:32 +0000 Subject: [PATCH] Defer sanity checks of dir attribute to the point where the fileset will be used for the first time. This will enable things like git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268830 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 4 ++++ src/main/org/apache/tools/ant/types/FileSet.java | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index f6ab3cfe3..8a3d956ff 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -29,6 +29,10 @@ Fixed bugs: * now deletes more than just the leaf directories. +* You can now specify a for a directory that doesn't exist at + declaration time but will created before the fileset gets used for the + first time. + Changes from Ant 1.2 to Ant 1.3 =========================================== diff --git a/src/main/org/apache/tools/ant/types/FileSet.java b/src/main/org/apache/tools/ant/types/FileSet.java index da2f23259..8545d808b 100644 --- a/src/main/org/apache/tools/ant/types/FileSet.java +++ b/src/main/org/apache/tools/ant/types/FileSet.java @@ -116,12 +116,6 @@ public class FileSet extends DataType { throw tooManyAttributes(); } - if (!dir.exists()) { - throw new BuildException(dir.getAbsolutePath()+" not found."); - } - if (!dir.isDirectory()) { - throw new BuildException(dir.getAbsolutePath()+" is not a directory."); - } this.dir = dir; } @@ -242,6 +236,13 @@ public class FileSet extends DataType { throw new BuildException("No directory specified for fileset."); } + if (!dir.exists()) { + throw new BuildException(dir.getAbsolutePath()+" not found."); + } + if (!dir.isDirectory()) { + throw new BuildException(dir.getAbsolutePath()+" is not a directory."); + } + DirectoryScanner ds = new DirectoryScanner(); setupDirectoryScanner(ds, p); ds.scan();