diff options
Diffstat (limited to 'archiva-modules/archiva-maven/archiva-maven-proxy/src')
2 files changed, 8 insertions, 11 deletions
diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java index 039ca0376..32560ebdd 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java @@ -19,7 +19,6 @@ package org.apache.archiva.proxy.maven; * under the License. */ -import org.apache.archiva.model.RepositoryURL; import org.apache.archiva.proxy.DefaultRepositoryProxyHandler; import org.apache.archiva.proxy.NotFoundException; import org.apache.archiva.proxy.NotModifiedException; @@ -27,7 +26,10 @@ import org.apache.archiva.proxy.ProxyException; import org.apache.archiva.proxy.model.NetworkProxy; import org.apache.archiva.proxy.model.ProxyConnector; import org.apache.archiva.proxy.model.RepositoryProxyHandler; -import org.apache.archiva.repository.*; +import org.apache.archiva.repository.ManagedRepository; +import org.apache.archiva.repository.RemoteRepository; +import org.apache.archiva.repository.RepositoryCredentials; +import org.apache.archiva.repository.RepositoryType; import org.apache.archiva.repository.base.PasswordCredentials; import org.apache.archiva.repository.storage.StorageAsset; import org.apache.commons.lang3.StringUtils; @@ -45,6 +47,7 @@ import org.springframework.stereotype.Service; import javax.inject.Inject; import java.io.IOException; +import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; @@ -116,14 +119,15 @@ public class MavenRepositoryProxyHandler extends DefaultRepositoryProxyHandler { * @throws ProxyException * @throws NotModifiedException */ + @Override protected void transferResources( ProxyConnector connector, RemoteRepository remoteRepository, StorageAsset tmpResource, StorageAsset[] checksumFiles, String url, String remotePath, StorageAsset resource, Path workingDirectory, ManagedRepository repository ) throws ProxyException, NotModifiedException { Wagon wagon = null; try { - RepositoryURL repoUrl = remoteRepository.getContent().getURL(); - String protocol = repoUrl.getProtocol(); + URI repoUrl = remoteRepository.getLocation( ); + String protocol = repoUrl.getScheme( ); NetworkProxy networkProxy = null; String proxyId = connector.getProxyId(); if (StringUtils.isNotBlank(proxyId)) { diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java index 6e51de0c0..7aacf06b0 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java @@ -20,7 +20,6 @@ package org.apache.archiva.repository.mock; */ import org.apache.archiva.common.utils.VersionUtil; -import org.apache.archiva.model.RepositoryURL; import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.RemoteRepository; import org.apache.archiva.repository.RemoteRepositoryContent; @@ -53,12 +52,6 @@ public class RemoteRepositoryContentMock implements RemoteRepositoryContent } @Override - public RepositoryURL getURL( ) - { - return new RepositoryURL(repository.getLocation().toString()); - } - - @Override public void setRepository( RemoteRepository repo ) { this.repository = repo; |