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