ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Suggested change to to check failonerror flag when unable to delete source file as part of move
Date Mon, 11 Apr 2005 18:22:30 GMT
A couple of weeks back I sent the following to the ant user list without
any response.  I am thinking that the dev list would have been a better
place for this request.  Can someone here give this a read and let me know
if this change can be accepted back into the ant source.


Gary Bartlett


I have some ant scripts that manage archiving files between NT servers in
our production environment.  A while back the move task began failing with
an error related to deleting the source file (see below)

     [move] Warning: Unable to delete file \\server\foo\bar.log

Under ant 162 when this happens the move task stops processing the list of
files to move  - but the ant script does not fail.

I have the move task configured with failonerror=false - but looking at the
code it seems that this parameter is not honored by the move class.   I
made a couple of changes locally to have the move class check this flag and
conditionally issue a warning as opposed to an abort - and was wondering if
these changes could get committed into the base code.

Here are the changes:


<              boolean failOnError = getFailOnError();
<                String message = "Unable to delete "
>                 throw new BuildException("Unable to delete "
<                                         + fromFile.getAbsolutePath()
<                                       + " FailOnError is "+failOnError;
<               if (failOnError) {
<                       throw new BuildException(message);
<               } else {
<                         log(message);
<               }
>                                         + fromFile.getAbsolutePath());  (added accessor to the failonerror flag)

<     public boolean getFailOnError() {
<         return failonerror;
<     }


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message