Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 67336 invoked by uid 500); 6 Feb 2003 16:19:26 -0000 Received: (qmail 67311 invoked from network); 6 Feb 2003 16:19:25 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 6 Feb 2003 16:19:25 -0000 Received: (qmail 11873 invoked by uid 1146); 6 Feb 2003 16:19:25 -0000 Date: 6 Feb 2003 16:19:25 -0000 Message-ID: <20030206161925.11871.qmail@icarus.apache.org> From: bodewig@apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Copy.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bodewig 2003/02/06 08:19:24 Modified: src/main/org/apache/tools/ant/taskdefs Copy.java Log: Try to clean up after a failed copy. PR: 16768 Revision Changes Path 1.50 +6 -2 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copy.java Index: Copy.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copy.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- Copy.java 4 Dec 2002 16:42:30 -0000 1.49 +++ Copy.java 6 Feb 2003 16:19:22 -0000 1.50 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -531,6 +531,10 @@ } catch (IOException ioe) { String msg = "Failed to copy " + fromFile + " to " + toFile + " due to " + ioe.getMessage(); + File targetFile = new File(toFile); + if (targetFile.exists() && !targetFile.delete()) { + msg += " and I couldn't delete the corrupt " + toFile; + } throw new BuildException(msg, ioe, getLocation()); } }