mirror of
https://github.com/apache/archiva.git
synced 2025-02-21 01:15:08 +00:00
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:
parent
321a75da80
commit
a12ef6e863
@ -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 );
|
||||
}
|
||||
|
||||
|
@ -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() );
|
||||
|
Loading…
x
Reference in New Issue
Block a user