You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2013/04/17 01:18:39 UTC

svn commit: r1468668 - /commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java

Author: sebb
Date: Tue Apr 16 23:18:39 2013
New Revision: 1468668

URL: http://svn.apache.org/r1468668
Log:
IO-372 FileUtils.moveDirectory can produce misleading error message on failiure
Oops - wrong separator used

Modified:
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1468668&r1=1468667&r2=1468668&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Tue Apr 16 23:18:39 2013
@@ -2812,7 +2812,7 @@ public class FileUtils {
         }
         final boolean rename = srcDir.renameTo(destDir);
         if (!rename) {
-            if (destDir.getCanonicalPath().startsWith(srcDir.getCanonicalPath() + File.pathSeparator)) {
+            if (destDir.getCanonicalPath().startsWith(srcDir.getCanonicalPath() + File.separator)) {
                 throw new IOException("Cannot move directory: "+srcDir+" to a subdirectory of itself: "+destDir);
             }
             copyDirectory( srcDir, destDir );