]> source.dussan.org Git - archiva.git/commitdiff
PR: MRM-43
authorEdwin L. Punzalan <epunzalan@apache.org>
Wed, 8 Feb 2006 03:30:58 +0000 (03:30 +0000)
committerEdwin L. Punzalan <epunzalan@apache.org>
Wed, 8 Feb 2006 03:30:58 +0000 (03:30 +0000)
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

maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java
maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java

index 7d54c9b4e363ccd9fbe6ac52da1245c9c17a766c..55f78435bee09f250a5c30ca93945ad2a76bb1c0 100644 (file)
@@ -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 );
     }
 
index afd2363afd276dd38830249e80bae83f9a61ee7c..43ac0e696f3820b9576eaeb3148fd368dec20d53 100644 (file)
@@ -50,7 +50,7 @@ public class ProxyConfigurationTest
     public void testRepositoryCache()\r
     {\r
         File cacheFile = new File( "target/proxy-cache" );\r
-        config.setRepositoryCachePath( "file://" + cacheFile.getAbsolutePath() );\r
+        config.setRepositoryCachePath( cacheFile.getAbsolutePath() );\r
         ArtifactRepository cache = config.getRepositoryCache();\r
         assertEquals( cacheFile.getAbsolutePath(), cache.getBasedir() );\r
         assertEquals( config.getRepositoryCachePath(), cache.getBasedir() );\r