List artifacts = new ArrayList();
- List artifactPaths = scanForArtifactPaths( repositoryBase, blacklistedPatterns );
-
- for ( Iterator i = artifactPaths.iterator(); i.hasNext(); )
+ if ( repositoryBase.exists() )
{
- String path = (String) i.next();
+ List artifactPaths = scanForArtifactPaths( repositoryBase, blacklistedPatterns );
- try
+ for ( Iterator i = artifactPaths.iterator(); i.hasNext(); )
{
- Artifact artifact = buildArtifactFromPath( path, repository );
-
- if ( filter.include( artifact ) )
+ String path = (String) i.next();
+
+ try
{
- artifacts.add( artifact );
+ Artifact artifact = buildArtifactFromPath( path, repository );
+
+ if ( filter.include( artifact ) )
+ {
+ artifacts.add( artifact );
+ }
+ else
+ {
+ addExcludedPath( path, "Omitted by filter" );
+ }
}
- else
+ catch ( DiscovererException e )
{
- addExcludedPath( path, "Omitted by filter" );
+ addKickedOutPath( path, e.getMessage() );
}
}
- catch ( DiscovererException e )
- {
- addKickedOutPath( path, e.getMessage() );
- }
}
-
return artifacts;
}
}
List metadataFiles = new ArrayList();
- List metadataPaths = scanForArtifactPaths( new File( repository.getBasedir() ), blacklistedPatterns,
- STANDARD_DISCOVERY_INCLUDES, null );
- for ( Iterator i = metadataPaths.iterator(); i.hasNext(); )
+ File repositoryBase = new File( repository.getBasedir() );
+ if ( repositoryBase.exists() )
{
- String metadataPath = (String) i.next();
- try
+ List metadataPaths = scanForArtifactPaths( repositoryBase, blacklistedPatterns,
+ STANDARD_DISCOVERY_INCLUDES, null );
+
+ for ( Iterator i = metadataPaths.iterator(); i.hasNext(); )
{
- RepositoryMetadata metadata = buildMetadata( repository.getBasedir(), metadataPath );
- File f = new File( repository.getBasedir(), metadataPath );
- if ( filter.include( metadata, f.lastModified() ) )
+ String metadataPath = (String) i.next();
+ try
{
- metadataFiles.add( metadata );
+ RepositoryMetadata metadata = buildMetadata( repository.getBasedir(), metadataPath );
+ File f = new File( repository.getBasedir(), metadataPath );
+ if ( filter.include( metadata, f.lastModified() ) )
+ {
+ metadataFiles.add( metadata );
+ }
+ else
+ {
+ addExcludedPath( metadataPath, "Metadata excluded by filter" );
+ }
}
- else
+ catch ( DiscovererException e )
{
- addExcludedPath( metadataPath, "Metadata excluded by filter" );
+ addKickedOutPath( metadataPath, e.getMessage() );
}
}
- catch ( DiscovererException e )
- {
- addKickedOutPath( metadataPath, e.getMessage() );
- }
}
-
return metadataFiles;
}