You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2001/12/11 09:14:20 UTC

Re: Problem copying file using ANT API

On Tue, 11 Dec 2001, Shiladitya Ghosh <Sh...@hpsglobal.com>
wrote:

> 		Copy cpy = new Copy();

*never* instantiate an Ant task directly.  In your case,

                Copy cpy = (Copy) project.createTask("copy");

will avoid the Exception, but is still unsafe (we may chose to change
the class implementing the copy task in the future).

To copy a file, take a look at org.apache.tools.ant.util.FileUtils.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>