Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 8070 invoked from network); 18 Jul 2008 09:08:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jul 2008 09:08:16 -0000 Received: (qmail 17237 invoked by uid 500); 18 Jul 2008 09:08:16 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 17186 invoked by uid 500); 18 Jul 2008 09:08:16 -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 17177 invoked by uid 99); 18 Jul 2008 09:08:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jul 2008 02:08:16 -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; Fri, 18 Jul 2008 09:07:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2BB7C2388A06; Fri, 18 Jul 2008 02:07:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r677860 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs: Expand.java Untar.java Date: Fri, 18 Jul 2008 09:07:25 -0000 To: notifications@ant.apache.org From: bodewig@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080718090726.2BB7C2388A06@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bodewig Date: Fri Jul 18 02:07:25 2008 New Revision: 677860 URL: http://svn.apache.org/viewvc?rev=677860&view=rev Log: more explicit existence chacks in unzip/tar. PR 44843 Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Untar.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java?rev=677860&r1=677859&r2=677860&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java Fri Jul 18 02:07:25 2008 @@ -122,6 +122,10 @@ if (source.isDirectory()) { throw new BuildException("Src must not be a directory." + " Use nested filesets instead.", getLocation()); + } else if (!source.exists()) { + throw new BuildException("src '" + source + "' doesn't exist."); + } else if (!source.canRead()) { + throw new BuildException("src '" + source + "' cannot be read."); } else { expandFile(FILE_UTILS, source, dest); } @@ -130,6 +134,7 @@ while (iter.hasNext()) { Resource r = (Resource) iter.next(); if (!r.isExists()) { + log("Skipping '" + r.getName() + "' because it doesn't exist."); continue; } Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Untar.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Untar.java?rev=677860&r1=677859&r2=677860&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Untar.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Untar.java Fri Jul 18 02:07:25 2008 @@ -118,6 +118,13 @@ * @since Ant 1.7 */ protected void expandResource(Resource srcR, File dir) { + if (!srcR.isExists()) { + throw new BuildException("Unable to untar " + + srcR.getName() + + " as the it does not exist", + getLocation()); + } + InputStream i = null; try { i = srcR.getInputStream();