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
This commit is contained in:
Edwin L. Punzalan 2006-02-08 03:30:58 +00:00
parent 321a75da80
commit a12ef6e863
2 changed files with 6 additions and 4 deletions

View File

@ -26,6 +26,7 @@
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 boolean isBrowsable()
/**
* 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 void setRepositoryCachePath( String repoCacheURL )
ArtifactRepositoryLayout layout = new DefaultRepositoryLayout();
repoCache = artifactRepositoryFactory.createArtifactRepository( "localCache", repoCacheURL, layout,
repoCache = artifactRepositoryFactory.createArtifactRepository( "localCache", "file://" +
new File( path ).getAbsolutePath(), layout,
standardPolicy, standardPolicy );
}

View File

@ -50,7 +50,7 @@ public void testBrowsable()
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() );