ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Matèrne (jhm) <apa...@materne.de>
Subject AW: create a new fileset in Java and in Ant Task
Date Tue, 25 Feb 2014 16:34:23 GMT
The fileset needs a project instance.
getDS() is a short cut for getDS(getProject()) and your getProject() would
return null.
see:
https://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/an
t/types/AbstractFileSet.java

<copy> supports nested filesets so a view here would be a starting point.
https://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/an
t/taskdefs/Copy.java
It uses a FS as resource collection, but when searching more you'll find
                // Step (1) - beware of the ZipFileSet
                if (rc instanceof FileSet && rc.isFilesystemOnly()) {
                    FileSet fs = (FileSet) rc;
                    DirectoryScanner ds = null;
                    try {
                        ds = fs.getDirectoryScanner(getProject());


Jan


> -----Ursprüngliche Nachricht-----
> Von: Knuplesch, Jürgen [mailto:Juergen.Knuplesch@icongmbh.de]
> Gesendet: Dienstag, 25. Februar 2014 16:07
> An: Ant Users List
> Betreff: create a new fileset in Java and in Ant Task
> 
> Hello,
> 
> I want to create a new fileset inside a ANT-Task using this:
> 
>       FileSet createdFileset = new FileSet();
>       createdFileset.setDir(new File(basedir));
> 
> 
> When I do this to get the files:
> 
>      createdFileset.getDirectoryScanner();
> 
> I get a NPE.
> 
> 
> What else do I need to do to set up a new fileset?
> Cant find it somewhere else )-:
> 
> Juergen
> --
> 
> Juergen Knuplesch
> 
>         http://www.icongmbh.de
> 
> Application Development
> 
> icon Systemhaus GmbH
> 
>         Tel. +49 711 806098-275
> 
> Hauptstätter Straße 70
> 
> 
> 
> 70178 Stuttgart
> 
>         Fax. +49 711 806098-299
> 
> 
> Geschäftsführer: Uwe Seltmann, Andreas Schwegler HRB Stuttgart 17655
> USt-IdNr.: DE 811944121
> 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++
> Werden Sie DOPiX-Experte! Buchen Sie unsere auf Ihre Anforderungen
> ausgelegten Schulungen unter: www.icongmbh.de/schulungen-und-
> seminare.html
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++


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


Mime
View raw message