From fd29c31a300948181e25750d298edb2f4a122d45 Mon Sep 17 00:00:00 2001 From: Emmanuel Venisse Date: Thu, 5 Oct 2006 14:34:06 +0000 Subject: [PATCH] Fix FNFE when basedir contains spaces git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@453251 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/discoverer/AbstractDiscoverer.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/AbstractDiscoverer.java b/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/AbstractDiscoverer.java index b902d67c5..b6d17c44d 100644 --- a/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/AbstractDiscoverer.java +++ b/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/AbstractDiscoverer.java @@ -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 );