{
throw new IllegalArgumentException( "Only supports managed repositories." );
}
// Attempt to get the specified indexDir in the configuration first.
RepositoryConfiguration repoConfig = configuration.getConfiguration().findRepositoryById( repository.getId() );
File indexDir;
if ( repoConfig == null )
{
// No configured index dir, use the repository path instead.
String repoPath = repository.getUrl().getPath();
indexDir = new File( repoPath, ".index/" + indexId + "/" );
}
else
{
// Use configured index dir.
String repoPath = repoConfig.getIndexDir();
if ( StringUtils.isBlank( repoPath ) )
{
repoPath = repository.getUrl().getPath();
if ( !repoPath.endsWith( "/" ) )
{