Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 35547 invoked from network); 25 Jun 2008 14:40:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2008 14:40:51 -0000 Received: (qmail 34626 invoked by uid 500); 25 Jun 2008 14:40:53 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 34602 invoked by uid 500); 25 Jun 2008 14:40:53 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 34593 invoked by uid 99); 25 Jun 2008 14:40:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 07:40:53 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 14:40:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D50E4238895D; Wed, 25 Jun 2008 07:40:30 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r671574 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java Date: Wed, 25 Jun 2008 14:40:30 -0000 To: notifications@ant.apache.org From: xavier@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080625144030.D50E4238895D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: xavier Date: Wed Jun 25 07:40:30 2008 New Revision: 671574 URL: http://svn.apache.org/viewvc?rev=671574&view=rev Log: handle case where transaction destination directory already exists (which makes the commit impossible) (probably related to IVY-733) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java?rev=671574&r1=671573&r2=671574&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java Wed Jun 25 07:40:30 2008 @@ -136,6 +136,11 @@ if (!isTransactionStarted()) { throw new IllegalStateException("no current transaction!"); } + if (transactionDestDir.exists()) { + throw new IOException( + "impossible to commit transaction: transaction destination directory " + + "already exists: " + transactionDestDir); + } try { getFileRepository().move(transactionTempDir, transactionDestDir); @@ -172,10 +177,16 @@ unsupportedTransaction("overwrite transaction not supported yet"); } else { initTransaction(module); - Message.verbose( - "\tstarting transaction: publish during transaction will be done in \n\t\t" - + transactionTempDir - + "\n\t\tand on commit moved to \n\t\t" + transactionDestDir); + if (transactionDestDir.exists()) { + unsupportedTransaction( + "transaction destination directory already exists: " + transactionDestDir); + closeTransaction(); + } else { + Message.verbose( + "\tstarting transaction: publish during transaction will be done in \n\t\t" + + transactionTempDir + + "\n\t\tand on commit moved to \n\t\t" + transactionDestDir); + } } } }