From ec53cbb02a54af81b299b610acdbdda516f623b1 Mon Sep 17 00:00:00 2001
From: Matthew Jason Benson
Date: Wed, 14 Sep 2005 21:24:08 +0000
Subject: [PATCH] delete + resource collection support
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@280944 13f79535-47bb-0310-9956-ffa450edef68
---
docs/manual/CoreTasks/delete.html | 29 ++---
src/etc/testcases/taskdefs/delete.xml | 100 ++++++++++++++++--
.../org/apache/tools/ant/taskdefs/Delete.java | 77 ++++++++------
.../tools/ant/types/resources/BCFileSet.java | 71 +++++++++++++
.../resources/comparators/FileSystem.java | 48 +++++++++
.../org/apache/tools/ant/util/FileUtils.java | 21 ++++
.../apache/tools/ant/taskdefs/DeleteTest.java | 17 ++-
7 files changed, 306 insertions(+), 57 deletions(-)
create mode 100644 src/main/org/apache/tools/ant/types/resources/BCFileSet.java
create mode 100644 src/main/org/apache/tools/ant/types/resources/comparators/FileSystem.java
diff --git a/docs/manual/CoreTasks/delete.html b/docs/manual/CoreTasks/delete.html
index c72da8913..579c82bd2 100644
--- a/docs/manual/CoreTasks/delete.html
+++ b/docs/manual/CoreTasks/delete.html
@@ -12,11 +12,14 @@
Description
Deletes a single file, a specified directory and all its files and
subdirectories, or a set of files specified by one or more
-FileSets.
-When specifying a set of files, empty directories are not removed by
-default.
-To remove empty directories, use the includeEmptyDirs
attribute.
-
+resource collections.
+The literal implication of <fileset>
is that
+directories are not included; however the removal of empty directories can
+be triggered when using nested filesets by setting the
+includeEmptyDirs
attribute to true. Note that this
+attribute is meaningless in the context of any of the various resource
+collection types that do include directories, but that no attempt
+will be made to delete non-empty directories in any case.
If you use this task to delete temporary files created by editors
and it doesn't seem to work, read up on the
@@ -37,7 +40,7 @@ in Directory-based Tasks, and see the
filename (if the file exists in the current base directory), a
relative-path filename, or a full-path filename.
At least one of the two,
- unless a <fileset> is specified. |
+ unless nested resource collections are specified
dir |
@@ -88,7 +91,7 @@ in Directory-based Tasks, and see the
includes |
- Deprecated. Use <fileset> .
+ | Deprecated. Use resource collections.
Comma- or space-separated list of patterns of
files that must be deleted. All files are relative to the directory
specified in dir . |
@@ -96,14 +99,14 @@ in Directory-based Tasks, and see the
includesfile |
- Deprecated. Use <fileset> .
+ | Deprecated. Use resource collections.
The name of a file. Each line of
this file is taken to be an include pattern. |
No |
excludes |
- Deprecated. Use <fileset> .
+ | Deprecated. Use resource collections.
Comma- or space-separated list of patterns of
files that must be excluded from the deletion list.
All files are relative to the directory specified in dir .
@@ -112,14 +115,14 @@ in Directory-based Tasks, and see the
|
excludesfile |
- Deprecated. Use <fileset> .
+ | Deprecated. Use resource collections.
The name of a file. Each line of
this file is taken to be an exclude pattern |
No |
defaultexcludes |
- Deprecated. Use <fileset> .
+ | Deprecated. Use resource collections.
Whether to use
default excludes. |
No, default "true" |
@@ -131,7 +134,7 @@ in Directory-based Tasks, and see the
failure to delete a file, this causes the jvm to attempt
to delete the file when the jvm process is terminating.
Since Ant 1.6.2
- No, default "false". |
+ No, default "false" |
Examples
@@ -158,7 +161,7 @@ and any subdirectories.
deletes all files and subdirectories of build
, without
build
itself.
-
Copyright © 2000-2002,2004-2005 The Apache Software Foundation.
+
Copyright © 2000-2002, 2004-2005 The Apache Software Foundation.
All rights Reserved.