ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types AbstractFileSet.java
Date Mon, 02 Sep 2002 15:14:29 GMT
ehatcher    2002/09/02 08:14:29

  Modified:    src/main/org/apache/tools/ant/types Tag: ANT_15_BRANCH
                        AbstractFileSet.java
  Log:
  backported approved 'file' attribute to 1.5 branch
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.7   +15 -0     jakarta-ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.5.2.6
  retrieving revision 1.5.2.7
  diff -u -r1.5.2.6 -r1.5.2.7
  --- AbstractFileSet.java	6 Jul 2002 00:00:30 -0000	1.5.2.6
  +++ AbstractFileSet.java	2 Sep 2002 15:14:29 -0000	1.5.2.7
  @@ -58,6 +58,7 @@
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.types.selectors.*;
  +import org.apache.tools.ant.util.FileUtils;
   
   import java.io.File;
   import java.util.Stack;
  @@ -188,6 +189,20 @@
           return defaultPatterns.createExclude();
       }
   
  +    /**
  +     * Creates a single file fileset.
  +     */
  +    public void setFile(File file) {
  +        if (isReference()) {
  +            throw tooManyAttributes();
  +        }
  +        FileUtils fileUtils = FileUtils.newFileUtils();
  +        setDir(fileUtils.getParentFile(file));
  +
  +        PatternSet.NameEntry include = createInclude();
  +        include.setName(file.getName());
  +    }
  +    
       /**
        * add a name entry on the include files list
        */
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message