From 4f04b8d8310845e9c2b539409c029cbf4cdf1eb0 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Wed, 14 Aug 2002 14:28:00 +0000 Subject: [PATCH] Why this has not been done before is beyond me, but its something I can't live without! :) I typically have properties that refer to a JAR file, but its very difficult to construct a fileset to copy it or include it in a WAR/EAR - so this change fixes this. If this change is ok with everyone I'll take care of documenting it. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273222 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/types/AbstractFileSet.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/org/apache/tools/ant/types/AbstractFileSet.java b/src/main/org/apache/tools/ant/types/AbstractFileSet.java index eaf2aaa52..911f0dec0 100644 --- a/src/main/org/apache/tools/ant/types/AbstractFileSet.java +++ b/src/main/org/apache/tools/ant/types/AbstractFileSet.java @@ -213,6 +213,17 @@ public abstract class AbstractFileSet extends DataType implements Cloneable, return defaultPatterns.createExcludesFile(); } + /** + * Creates a single file fileset. + */ + public void setFile(File file) { + if (isReference()) { + throw tooManyAttributes(); + } + setDir(file.getParentFile()); + setIncludes(file.getName()); + } + /** * Appends includes to the current list of include * patterns.