aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-maven
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2020-06-16 10:57:24 +0200
committerMartin Stockhammer <martin_s@apache.org>2020-06-16 10:57:24 +0200
commit9a2860b467d9c130c2d5ddf76ba3c3dd9c34442a (patch)
treea60a51a9a1c943cb3127e3592e3e97825d5cca43 /archiva-modules/archiva-maven
parent7a9803bf0f648db101ff9e76ef6a0f0bb2ecf09d (diff)
downloadarchiva-9a2860b467d9c130c2d5ddf76ba3c3dd9c34442a.tar.gz
archiva-9a2860b467d9c130c2d5ddf76ba3c3dd9c34442a.zip
Removing reference to URL in content API
Diffstat (limited to 'archiva-modules/archiva-maven')
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java12
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java7
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java15
3 files changed, 8 insertions, 26 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;
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java
index 532062948..09876cb9b 100644
--- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java
+++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java
@@ -18,7 +18,6 @@ package org.apache.archiva.repository.maven.content;
* under the License.
*/
-import org.apache.archiva.model.RepositoryURL;
import org.apache.archiva.repository.RemoteRepository;
import org.apache.archiva.repository.RemoteRepositoryContent;
@@ -49,20 +48,6 @@ public class RemoteDefaultRepositoryContent
}
@Override
- public RepositoryURL getURL( )
- {
- try
- {
- return new RepositoryURL( repository.getLocation( ).toString( ) );
- }
- catch ( Exception e )
- {
- log.error( "Could not convert location url {}", repository.getLocation( ) );
- return new RepositoryURL( "" );
- }
- }
-
- @Override
public void setRepository( RemoteRepository repository )
{
this.repository = repository;