Moved releases and snapshot policies into the proxy configuration class

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@414095 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Edwin L. Punzalan 2006-06-14 05:54:38 +00:00
parent f844217297
commit bc577a44eb
2 changed files with 38 additions and 5 deletions

View File

@ -303,14 +303,12 @@ public class DefaultProxyManager
private ArtifactRepositoryPolicy getReleasesPolicy() private ArtifactRepositoryPolicy getReleasesPolicy()
{ {
//todo get policy configuration from ProxyConfiguration return config.getCacheReleasePolicy();
return new ArtifactRepositoryPolicy();
} }
private ArtifactRepositoryPolicy getSnapshotsPolicy() private ArtifactRepositoryPolicy getSnapshotsPolicy()
{ {
//todo get policy configuration from ProxyConfiguration return config.getCacheSnapshotPolicy();
return new ArtifactRepositoryPolicy();
} }
public URL getRepositoryCacheURL() public URL getRepositoryCacheURL()

View File

@ -16,14 +16,15 @@ package org.apache.maven.repository.proxy.configuration;
* limitations under the License. * limitations under the License.
*/ */
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.repository.proxy.repository.ProxyRepository; import org.apache.maven.repository.proxy.repository.ProxyRepository;
import org.apache.maven.wagon.proxy.ProxyInfo; import org.apache.maven.wagon.proxy.ProxyInfo;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
/** /**
* Class to represent the configuration file for the proxy * Class to represent the configuration file for the proxy
@ -40,6 +41,10 @@ public class ProxyConfiguration
private ProxyInfo httpProxy; private ProxyInfo httpProxy;
private ArtifactRepositoryPolicy cacheReleasePolicy;
private ArtifactRepositoryPolicy cacheSnapshotPolicy;
/** /**
* Used to set the location where the proxy should cache the configured repositories * Used to set the location where the proxy should cache the configured repositories
* *
@ -183,4 +188,34 @@ public class ProxyConfiguration
} }
} }
} }
public ArtifactRepositoryPolicy getCacheReleasePolicy()
{
if ( cacheReleasePolicy == null )
{
cacheReleasePolicy = new ArtifactRepositoryPolicy();
}
return cacheReleasePolicy;
}
public void setCacheReleasePolicy( ArtifactRepositoryPolicy cacheReleasePolicy )
{
this.cacheReleasePolicy = cacheReleasePolicy;
}
public ArtifactRepositoryPolicy getCacheSnapshotPolicy()
{
if ( cacheSnapshotPolicy == null )
{
cacheSnapshotPolicy = new ArtifactRepositoryPolicy();
}
return cacheSnapshotPolicy;
}
public void setCacheSnapshotPolicy( ArtifactRepositoryPolicy cacheSnapshotPolicy )
{
this.cacheSnapshotPolicy = cacheSnapshotPolicy;
}
} }