diff options
author | Olivier Lamy <olamy@apache.org> | 2013-02-06 22:49:40 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-02-06 22:49:40 +0000 |
commit | b978de05ff5cda0c7293a615cc4aaed34449d092 (patch) | |
tree | 16deac96ebc620c9a6e8f68e6679d9beeea4ef77 | |
parent | 53f8581435af066f8f470c46013c2e0962494113 (diff) | |
download | archiva-b978de05ff5cda0c7293a615cc4aaed34449d092.tar.gz archiva-b978de05ff5cda0c7293a615cc4aaed34449d092.zip |
fix issue when creating repository with relative path index used a wrong repository directory
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1443259 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index 0ecdb3724..2fc8f7235 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -588,7 +588,7 @@ public class DefaultManagedRepositoryAdmin if ( context != null ) { - log.debug( "skip adding repository indexingContent with id {} as already exists", repository.getId() ); + log.debug( "skip creating repository indexingContent with id {} as already exists", repository.getId() ); return context; } @@ -610,10 +610,8 @@ public class DefaultManagedRepositoryAdmin try { - - String indexDir = repository.getIndexDirectory(); - File managedRepository = new File( repository.getLocation() ); + //File managedRepository = new File( repository.getLocation() ); File indexDirectory = null; if ( StringUtils.isNotBlank( indexDir ) ) @@ -622,14 +620,14 @@ public class DefaultManagedRepositoryAdmin // not absolute so create it in repository directory if ( !indexDirectory.isAbsolute() ) { - indexDirectory = new File( managedRepository, repository.getIndexDirectory() ); + indexDirectory = new File( repositoryDirectory, repository.getIndexDirectory() ); repository.setIndexDirectory( indexDirectory.getAbsolutePath() ); } } else { - indexDirectory = new File( managedRepository, ".indexer" ); - if ( !managedRepository.isAbsolute() ) + indexDirectory = new File( repositoryDirectory, ".indexer" ); + if ( !repositoryDirectory.isAbsolute() ) { indexDirectory = new File( repositoryDirectory, ".indexer" ); repository.setIndexDirectory( indexDirectory.getAbsolutePath() ); @@ -645,9 +643,9 @@ public class DefaultManagedRepositoryAdmin if ( context == null ) { - context = indexer.addIndexingContext( repository.getId(), repository.getId(), managedRepository, + context = indexer.addIndexingContext( repository.getId(), repository.getId(), repositoryDirectory, indexDirectory, - managedRepository.toURI().toURL().toExternalForm(), + repositoryDirectory.toURI().toURL().toExternalForm(), indexDirectory.toURI().toURL().toString(), indexCreators ); context.setSearchable( repository.isScanned() ); |