]> source.dussan.org Git - archiva.git/commitdiff
Fix FNFE when basedir contains spaces
authorEmmanuel Venisse <evenisse@apache.org>
Thu, 5 Oct 2006 14:34:06 +0000 (14:34 +0000)
committerEmmanuel Venisse <evenisse@apache.org>
Thu, 5 Oct 2006 14:34:06 +0000 (14:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@453251 13f79535-47bb-0310-9956-ffa450edef68

archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/AbstractDiscoverer.java

index b902d67c57628a0278d88982bbfb7db9de243cec..b6d17c44dd32bde08b05df59cc06052b7c64d8a3 100644 (file)
@@ -22,6 +22,7 @@ import org.codehaus.plexus.util.DirectoryScanner;
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -103,7 +104,17 @@ public abstract class AbstractDiscoverer
         }
 
         DirectoryScanner scanner = new DirectoryScanner();
-        scanner.setBasedir( repositoryBase );
+        try
+        {
+            //Fix FNFE when repositoryBase contain spaces
+            //TODO: move this code in DirectoryScanner.setBasedir()
+            scanner.setBasedir( repositoryBase.getCanonicalFile() );
+        }
+        catch( IOException e )
+        {
+            scanner.setBasedir( repositoryBase );
+        }
+
         if ( includes != null )
         {
             scanner.setIncludes( includes );