]> source.dussan.org Git - archiva.git/commitdiff
Moved releases and snapshot policies into the proxy configuration class
authorEdwin L. Punzalan <epunzalan@apache.org>
Wed, 14 Jun 2006 05:54:38 +0000 (05:54 +0000)
committerEdwin L. Punzalan <epunzalan@apache.org>
Wed, 14 Jun 2006 05:54:38 +0000 (05:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@414095 13f79535-47bb-0310-9956-ffa450edef68

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

index 06e1726696e5fb8b01ec675c7ef772d0faa5b6ae..881b41e2dcdf49e0b63c6ae02753db9d4820c6cc 100644 (file)
@@ -303,14 +303,12 @@ public class DefaultProxyManager
 
     private ArtifactRepositoryPolicy getReleasesPolicy()
     {
-        //todo get policy configuration from ProxyConfiguration
-        return new ArtifactRepositoryPolicy();
+        return config.getCacheReleasePolicy();
     }
 
     private ArtifactRepositoryPolicy getSnapshotsPolicy()
     {
-        //todo get policy configuration from ProxyConfiguration
-        return new ArtifactRepositoryPolicy();
+        return config.getCacheSnapshotPolicy();
     }
 
     public URL getRepositoryCacheURL()
index 343792d6af93e250c5ff956c68df9b48454c858c..b23c895704d333a190b1767621221415ef7da7c8 100644 (file)
@@ -16,14 +16,15 @@ package org.apache.maven.repository.proxy.configuration;
  * limitations under the License.
  */
 
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
 import org.apache.maven.repository.proxy.repository.ProxyRepository;
 import org.apache.maven.wagon.proxy.ProxyInfo;
 
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.List;
 import java.util.Iterator;
+import java.util.List;
 
 /**
  * Class to represent the configuration file for the proxy
@@ -40,6 +41,10 @@ public class ProxyConfiguration
 
     private ProxyInfo httpProxy;
 
+    private ArtifactRepositoryPolicy cacheReleasePolicy;
+
+    private ArtifactRepositoryPolicy cacheSnapshotPolicy;
+
     /**
      * 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;
+    }
 }