Return-Path: Delivered-To: apmail-lucene-hadoop-commits-archive@locus.apache.org Received: (qmail 94595 invoked from network); 31 May 2006 20:26:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 May 2006 20:26:09 -0000 Received: (qmail 17442 invoked by uid 500); 31 May 2006 20:26:08 -0000 Delivered-To: apmail-lucene-hadoop-commits-archive@lucene.apache.org Received: (qmail 17417 invoked by uid 500); 31 May 2006 20:26:08 -0000 Mailing-List: contact hadoop-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-commits@lucene.apache.org Received: (qmail 17408 invoked by uid 99); 31 May 2006 20:26:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 May 2006 13:26:08 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 May 2006 13:26:07 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id E04001A983E; Wed, 31 May 2006 13:25:47 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r410659 - /lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java Date: Wed, 31 May 2006 20:25:47 -0000 To: hadoop-commits@lucene.apache.org From: cutting@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060531202547.E04001A983E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: cutting Date: Wed May 31 13:25:47 2006 New Revision: 410659 URL: http://svn.apache.org/viewvc?rev=410659&view=rev Log: Fix for paths that might contain spaces (e.g. on windows). Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java?rev=410659&r1=410658&r2=410659&view=diff ============================================================================== --- lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java (original) +++ lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java Wed May 31 13:25:47 2006 @@ -18,6 +18,8 @@ import java.io.IOException; import java.net.URI; +import java.net.URLEncoder; +import java.net.URLDecoder; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collections; @@ -246,8 +248,8 @@ URI srcurl = null; URI desturl = null; try { - srcurl = new URI(srcPath); - desturl = new URI(destPath); + srcurl = new URI(URLEncoder.encode(srcPath, "UTF-8")); + desturl = new URI(URLEncoder.encode(destPath, "UTF-8")); } catch (URISyntaxException ex) { throw new RuntimeException("URL syntax error.", ex); } @@ -265,9 +267,9 @@ srcfs = FileSystem.getNamed(srcFileSysName, conf); FileSystem destfs = FileSystem.getNamed(destFileSysName, conf); - srcPath = srcurl.getPath(); + srcPath = URLDecoder.decode(srcurl.getPath(), "UTF-8"); if ("".equals(srcPath)) { srcPath = "/"; } - destPath = desturl.getPath(); + destPath = URLDecoder.decode(desturl.getPath(), "UTF-8"); if ("".equals(destPath)) { destPath = "/"; } boolean isFile = false;