diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-06-11 14:33:00 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-06-11 14:33:00 +0200 |
commit | 46fd585f40f0264b8889154e1924eb8df991b0f3 (patch) | |
tree | 09408c7375f7e57d0760ef48b0ddae7be768e4ca /archiva-modules/archiva-web/archiva-webdav | |
parent | b942314aa27330a179acf17300fea6849bf89d4d (diff) | |
download | archiva-46fd585f40f0264b8889154e1924eb8df991b0f3.tar.gz archiva-46fd585f40f0264b8889154e1924eb8df991b0f3.zip |
Improving repository API
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webdav')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index 8528b658c..b83dcdb61 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -68,6 +68,7 @@ import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.RepositoryRequestInfo; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.ContentItem; +import org.apache.archiva.repository.content.ItemSelector; import org.apache.archiva.repository.storage.fs.FilesystemStorage; import org.apache.archiva.repository.storage.StorageAsset; import org.apache.archiva.metadata.audit.AuditListener; @@ -791,22 +792,23 @@ public class ArchivaDavResourceFactory try { // Get the artifact reference in a layout neutral way. - ArtifactReference artifact = repositoryRequestInfo.toArtifactReference( path ); +// ArtifactReference artifact = repositoryRequestInfo.toArtifactReference( path ); + ItemSelector selector = repositoryRequestInfo.toItemSelector( path ); - if ( artifact != null ) + if ( selector != null ) { String repositoryLayout = managedRepository.getLayout(); RepositoryStorage repositoryStorage = this.applicationContext.getBean( "repositoryStorage#" + repositoryLayout, RepositoryStorage.class ); - repositoryStorage.applyServerSideRelocation( managedRepository, artifact ); + selector = repositoryStorage.applyServerSideRelocation( managedRepository, selector ); - StorageAsset proxiedFile = proxyHandler.fetchFromProxies( managedRepository, artifact ); + StorageAsset proxiedFile = proxyHandler.fetchFromProxies( managedRepository, selector ); - resource.setPath( managedRepository.getContent().toPath( artifact ) ); + resource.setPath( managedRepository.getContent().toPath( selector ) ); - log.debug( "Proxied artifact '{}:{}:{}'", artifact.getGroupId(), artifact.getArtifactId(), - artifact.getVersion() ); + log.debug( "Proxied artifact '{}:{}:{}:{}'", selector.getNamespace(), selector.getArtifactId(), + selector.getVersion(), selector.getArtifactVersion() ); return ( proxiedFile != null ); } |