private File toFile( ArchivaArtifact artifact )
{
RepositoryConfiguration repoConfig = getRepository( artifact );
BidirectionalRepositoryLayout layout = null;
try
{
layout = layoutFactory.getLayout( artifact );
}
catch ( LayoutException e )
{
getLogger().warn( "Unable to determine layout of " + artifact + ": " + e.getMessage(), e );
return null;
}
String path = layout.toPath( artifact );
RepositoryURL url = new RepositoryURL( repoConfig.getUrl() );
return new File( url.getPath(), path );
}