From: Edwin L. Punzalan Date: Wed, 8 Feb 2006 03:30:58 +0000 (+0000) Subject: PR: MRM-43 X-Git-Tag: archiva-0.9-alpha-1~944 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a12ef6e863f8ff9f1a27b2008b65adde05d93100;p=archiva.git PR: MRM-43 Removed URL format requirement on cache path git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@375838 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java index 7d54c9b4e..55f78435b 100644 --- a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java +++ b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java @@ -26,6 +26,7 @@ import org.apache.maven.repository.proxy.repository.ProxyRepository; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.io.File; /** * Class to represent the configuration file for the proxy @@ -70,9 +71,9 @@ public class ProxyConfiguration /** * Used to set the location where the proxy should cache the configured repositories * - * @param repoCacheURL + * @param path */ - public void setRepositoryCachePath( String repoCacheURL ) + public void setRepositoryCachePath( String path ) { ArtifactRepositoryPolicy standardPolicy; standardPolicy = new ArtifactRepositoryPolicy( true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, @@ -80,7 +81,8 @@ public class ProxyConfiguration ArtifactRepositoryLayout layout = new DefaultRepositoryLayout(); - repoCache = artifactRepositoryFactory.createArtifactRepository( "localCache", repoCacheURL, layout, + repoCache = artifactRepositoryFactory.createArtifactRepository( "localCache", "file://" + + new File( path ).getAbsolutePath(), layout, standardPolicy, standardPolicy ); } diff --git a/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java b/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java index afd2363af..43ac0e696 100644 --- a/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java +++ b/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java @@ -50,7 +50,7 @@ public class ProxyConfigurationTest public void testRepositoryCache() { File cacheFile = new File( "target/proxy-cache" ); - config.setRepositoryCachePath( "file://" + cacheFile.getAbsolutePath() ); + config.setRepositoryCachePath( cacheFile.getAbsolutePath() ); ArtifactRepository cache = config.getRepositoryCache(); assertEquals( cacheFile.getAbsolutePath(), cache.getBasedir() ); assertEquals( config.getRepositoryCachePath(), cache.getBasedir() );