Fix FNFE when basedir contains spaces

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@453251 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2006-10-05 14:34:06 +00:00
parent 7968e6819e
commit fd29c31a30
1 changed files with 12 additions and 1 deletions

View 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 );