ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja Nagendra Kumar <Nagendra.R...@tejasoft.com>
Subject FileSet with copy fails with NPE..
Date Wed, 10 Dec 2008 13:58:04 GMT

Hi,

We are writing ant task, which needs to copy files based on  fileset
defination like this..

Copy c = createCopyTask();
			    FileSet fs = new FileSet();
			    fs.setProject(getProject());
			    fs.setDir(new File("."));
			    fs.setFile(f);
			    c.addFileset(fs);
			    c.execute();

where createCopyTask() is

private final Copy createCopyTask()
    {
	final Copy c = new Copy();
	c.setTodir(new File(getDestdir().getPath()));
	c.setIncludeEmptyDirs(false);
	c.setFailOnError(true);
	c.setOverwrite(false);
	c.setFlatten(false);
	return c;
    }

However this code is resulting in NPE with the following exception..

Could any one guide what is wrong here..

Regards,
Nagendra

    [C2SCp] java.lang.NullPointerException
    [C2SCp]     at
org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(AbstractFileSet.java:477)
    [C2SCp]     at
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:442)
    [C2SCp]     at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:431)
    [C2SCp]     at
com.tejasoft.ant.c2s.Class2SRCCopyTask.execute(Class2SRCCopyTask.java:73)
    [C2SCp]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    [C2SCp]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown
Source)
    [C2SCp]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [C2SCp]     at java.lang.reflect.Method.invoke(Method.java:623)
    [C2SCp]     at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [C2SCp]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [C2SCp]     at
org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
    [C2SCp]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    [C2SCp]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown
Source)
    [C2SCp]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [C2SCp]     at java.lang.reflect.Method.invoke(Method.java:623)
    [C2SCp]     at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [C2SCp]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [C2SCp]     at
org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
    [C2SCp]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    [C2SCp]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown
Source)
    [C2SCp]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [C2SCp]     at java.lang.reflect.Method.invoke(Method.java:623)
-- 
View this message in context: http://www.nabble.com/FileSet-with-copy-fails-with-NPE..-tp20935877p20935877.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


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


Mime
View raw message