diff options
author | Olivier Lamy <olamy@apache.org> | 2013-12-09 11:22:02 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-12-09 11:22:02 +0000 |
commit | 3f90ad3744ae501d1786306529803e1e05aa0536 (patch) | |
tree | 879cc62ba6a5724963182fce52492a16d764a223 /archiva-modules/plugins | |
parent | 4b7ba850f4a881e9429d334647504e4df73b26d7 (diff) | |
download | archiva-3f90ad3744ae501d1786306529803e1e05aa0536.tar.gz archiva-3f90ad3744ae501d1786306529803e1e05aa0536.zip |
finally use a relocation for MRM-1761
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1549548 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins')
-rw-r--r-- | archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java index a5e69850b..94cfd4302 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java @@ -38,6 +38,7 @@ import org.apache.archiva.metadata.model.ProjectVersionMetadata; import org.apache.archiva.metadata.repository.RepositorySessionFactory; import org.apache.archiva.metadata.repository.filter.Filter; import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest; +import org.apache.archiva.metadata.repository.storage.RelocationException; import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator; import org.apache.archiva.metadata.repository.storage.RepositoryStorage; import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException; @@ -765,10 +766,10 @@ public class Maven2RepositoryStorage } public String getFilePathWithVersion( final String requestPath, ManagedRepositoryContent managedRepositoryContent ) - throws XMLException + throws XMLException, RelocationException { - if (StringUtils.endsWith( requestPath, METADATA_FILENAME )) + if ( StringUtils.endsWith( requestPath, METADATA_FILENAME ) ) { return getFilePath( requestPath, managedRepositoryContent.getRepository() ); } @@ -811,6 +812,10 @@ public class Maven2RepositoryStorage artifactReference.getVersion(), "-SNAPSHOT" ) + "-" + timestamp + "-" + buildNumber ); + throw new RelocationException( + "/repository/" + managedRepositoryContent.getRepository().getId() + + ( StringUtils.startsWith( filePath, "/" ) ? "" : "/" ) + filePath, RelocationException.RelocationType.TEMPORARY ); + } return filePath; |