git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1355331 13f79535-47bb-0310-9956-ffa450edef68tags/archiva-1.4-M3
@@ -45,13 +45,13 @@ public interface ArchivaConfiguration | |||
*/ | |||
void save( Configuration configuration ) | |||
throws RegistryException, IndeterminateConfigurationException; | |||
/** | |||
* Determines if the configuration in use was as a result of a defaulted configuration. | |||
* | |||
* | |||
* @return true if the configuration was created from the default-archiva.xml as opposed | |||
* to being loaded from the usual locations of ${user.home}/.m2/archiva.xml or | |||
* ${appserver.base}/conf/archiva.xml | |||
* to being loaded from the usual locations of ${user.home}/.m2/archiva.xml or | |||
* ${appserver.base}/conf/archiva.xml | |||
*/ | |||
boolean isDefaulted(); | |||
@@ -61,24 +61,25 @@ public interface ArchivaConfiguration | |||
* @param listener the listener | |||
*/ | |||
void addListener( ConfigurationListener listener ); | |||
/** | |||
* Remove a configuration listener to stop notifications of changes to the configuration. | |||
* | |||
* @param listener the listener | |||
*/ | |||
void removeListener( ConfigurationListener listener ); | |||
/** | |||
* Add a registry listener to notify of events in plexus-registry. | |||
* | |||
* @param listener the listener | |||
* TODO: Remove in future. | |||
* TODO: Remove in future. | |||
*/ | |||
void addChangeListener( RegistryListener listener ); | |||
/** | |||
* reload configuration from file included registry | |||
* | |||
* @since 1.4-M1 | |||
*/ | |||
void reload(); |
@@ -20,7 +20,7 @@ package org.apache.archiva.configuration; | |||
*/ | |||
/** | |||
* ConfigurationEvent | |||
* ConfigurationEvent | |||
* | |||
* @version $Id$ | |||
*/ |
@@ -29,21 +29,21 @@ import org.apache.archiva.policies.DownloadErrorPolicy; | |||
import org.apache.archiva.policies.Policy; | |||
import org.apache.archiva.policies.PostDownloadPolicy; | |||
import org.apache.archiva.policies.PreDownloadPolicy; | |||
import org.apache.archiva.redback.components.evaluator.DefaultExpressionEvaluator; | |||
import org.apache.archiva.redback.components.evaluator.EvaluatorException; | |||
import org.apache.archiva.redback.components.evaluator.ExpressionEvaluator; | |||
import org.apache.archiva.redback.components.evaluator.sources.SystemPropertyExpressionSource; | |||
import org.apache.archiva.redback.components.registry.Registry; | |||
import org.apache.archiva.redback.components.registry.RegistryException; | |||
import org.apache.archiva.redback.components.registry.RegistryListener; | |||
import org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry; | |||
import org.apache.archiva.redback.components.springutils.ComponentContainer; | |||
import org.apache.commons.collections.CollectionUtils; | |||
import org.apache.commons.collections.ListUtils; | |||
import org.apache.commons.collections.MapUtils; | |||
import org.apache.commons.configuration.BaseConfiguration; | |||
import org.apache.commons.io.FileUtils; | |||
import org.apache.commons.lang.StringUtils; | |||
import org.apache.archiva.redback.components.evaluator.DefaultExpressionEvaluator; | |||
import org.apache.archiva.redback.components.evaluator.ExpressionEvaluator; | |||
import org.apache.archiva.redback.components.evaluator.sources.SystemPropertyExpressionSource; | |||
import org.apache.archiva.redback.components.springutils.ComponentContainer; | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
import org.springframework.stereotype.Service; |
@@ -23,13 +23,13 @@ import org.apache.archiva.common.FileTypeUtils; | |||
import org.apache.archiva.configuration.functors.FiletypeSelectionPredicate; | |||
import org.apache.archiva.configuration.io.registry.ConfigurationRegistryReader; | |||
import org.apache.archiva.redback.components.registry.Registry; | |||
import org.apache.archiva.redback.components.registry.RegistryException; | |||
import org.apache.archiva.redback.components.registry.RegistryListener; | |||
import org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry; | |||
import org.apache.commons.collections.CollectionUtils; | |||
import org.apache.commons.collections.Predicate; | |||
import org.apache.commons.configuration.CombinedConfiguration; | |||
import org.apache.tools.ant.types.selectors.SelectorUtils; | |||
import org.apache.archiva.redback.components.registry.RegistryException; | |||
import org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry; | |||
import org.springframework.stereotype.Service; | |||
import javax.annotation.PostConstruct; |
@@ -21,7 +21,6 @@ package org.apache.archiva.configuration; | |||
/** | |||
* An error in the configuration. | |||
* | |||
*/ | |||
public class InvalidConfigurationException | |||
extends Exception |
@@ -19,9 +19,9 @@ package org.apache.archiva.configuration; | |||
* under the License. | |||
*/ | |||
import org.apache.commons.lang.StringUtils; | |||
import org.apache.archiva.policies.ReleasesPolicy; | |||
import org.apache.archiva.policies.SnapshotsPolicy; | |||
import org.apache.commons.lang.StringUtils; | |||
import java.io.IOException; | |||
import java.io.InputStream; | |||
@@ -111,7 +111,7 @@ public class MavenProxyPropertyLoader | |||
} | |||
} | |||
@SuppressWarnings("unchecked") | |||
@SuppressWarnings( "unchecked" ) | |||
private Properties getSubset( Properties props, String prefix ) | |||
{ | |||
Enumeration keys = props.keys(); |
@@ -19,12 +19,12 @@ package org.apache.archiva.configuration.functors; | |||
* under the License. | |||
*/ | |||
import org.apache.archiva.configuration.FileType; | |||
import org.apache.commons.collections.Predicate; | |||
import org.apache.commons.lang.StringUtils; | |||
import org.apache.archiva.configuration.FileType; | |||
/** | |||
* FiletypeSelectionPredicate | |||
* FiletypeSelectionPredicate | |||
* | |||
* @version $Id$ | |||
*/ |
@@ -19,14 +19,14 @@ package org.apache.archiva.configuration.functors; | |||
* under the License. | |||
*/ | |||
import org.apache.commons.collections.Closure; | |||
import org.apache.archiva.configuration.FileType; | |||
import org.apache.commons.collections.Closure; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
/** | |||
* FiletypeToMapClosure | |||
* FiletypeToMapClosure | |||
* | |||
* @version $Id$ | |||
*/ |
@@ -24,7 +24,7 @@ import org.apache.archiva.configuration.NetworkProxyConfiguration; | |||
import java.util.Comparator; | |||
/** | |||
* NetworkProxyComparator | |||
* NetworkProxyComparator | |||
* | |||
* @version $Id$ | |||
*/ |
@@ -19,12 +19,12 @@ package org.apache.archiva.configuration.functors; | |||
* under the License. | |||
*/ | |||
import org.apache.archiva.configuration.NetworkProxyConfiguration; | |||
import org.apache.commons.collections.Predicate; | |||
import org.apache.commons.lang.StringUtils; | |||
import org.apache.archiva.configuration.NetworkProxyConfiguration; | |||
/** | |||
* NetworkProxySelectionPredicate | |||
* NetworkProxySelectionPredicate | |||
* | |||
* @version $Id$ | |||
*/ |
@@ -24,16 +24,15 @@ import org.apache.archiva.configuration.ProxyConnectorConfiguration; | |||
import java.util.Comparator; | |||
/** | |||
* @deprecated | |||
* ProxyConnectorConfigurationOrderComparator | |||
* | |||
* @version $Id$ | |||
* @deprecated ProxyConnectorConfigurationOrderComparator | |||
*/ | |||
public class ProxyConnectorConfigurationOrderComparator | |||
implements Comparator<ProxyConnectorConfiguration> | |||
{ | |||
private static ProxyConnectorConfigurationOrderComparator INSTANCE = new ProxyConnectorConfigurationOrderComparator(); | |||
private static ProxyConnectorConfigurationOrderComparator INSTANCE = | |||
new ProxyConnectorConfigurationOrderComparator(); | |||
public int compare( ProxyConnectorConfiguration o1, ProxyConnectorConfiguration o2 ) | |||
{ | |||
if ( o1 == null && o2 == null ) | |||
@@ -57,7 +56,7 @@ public class ProxyConnectorConfigurationOrderComparator | |||
{ | |||
return 1; | |||
} | |||
if ( o1.getOrder() != 0 && o2.getOrder() == 0 ) | |||
{ | |||
return -1; |
@@ -19,12 +19,13 @@ package org.apache.archiva.configuration.functors; | |||
* under the License. | |||
*/ | |||
import org.apache.archiva.configuration.ProxyConnectorConfiguration; | |||
import org.apache.commons.collections.Predicate; | |||
import org.apache.commons.lang.StringUtils; | |||
import org.apache.archiva.configuration.ProxyConnectorConfiguration; | |||
/** | |||
* ProxyConnectorPredicate | |||
* | |||
* @version $Id$ | |||
*/ | |||
public class ProxyConnectorSelectionPredicate | |||
@@ -47,8 +48,8 @@ public class ProxyConnectorSelectionPredicate | |||
if ( object instanceof ProxyConnectorConfiguration ) | |||
{ | |||
ProxyConnectorConfiguration connector = (ProxyConnectorConfiguration) object; | |||
return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils | |||
.equals( targetId, connector.getTargetRepoId() ) ); | |||
return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId, | |||
connector.getTargetRepoId() ) ); | |||
} | |||
return satisfies; |
@@ -28,7 +28,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | |||
import javax.inject.Inject; | |||
@RunWith( SpringJUnit4ClassRunner.class ) | |||
@ContextConfiguration( locations = {"classpath*:/META-INF/spring-context.xml"} ) | |||
@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml" } ) | |||
public class FileTypesTest | |||
extends TestCase | |||
{ | |||
@@ -67,13 +67,20 @@ public class FileTypesTest | |||
{ | |||
assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.gz" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.zip" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.md5" ) ); | |||
assertFalse( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.zip" ) ); | |||
assertFalse( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( | |||
"repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( | |||
"repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( | |||
"repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( | |||
"repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) ); | |||
assertTrue( filetypes.matchesDefaultExclusions( | |||
"repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.md5" ) ); | |||
assertFalse( filetypes.matchesDefaultExclusions( | |||
"repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.zip" ) ); | |||
assertFalse( filetypes.matchesDefaultExclusions( | |||
"repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); | |||
} | |||
} |
@@ -26,6 +26,7 @@ import org.junit.runners.JUnit4; | |||
/** | |||
* Test the generated LegacyArtifactPath class from Modello. This is primarily to test the hand coded methods. | |||
* | |||
* @since 1.1 | |||
*/ | |||
@RunWith( JUnit4.class ) |
@@ -19,6 +19,7 @@ package org.apache.archiva.configuration.functors; | |||
* under the License. | |||
*/ | |||
import junit.framework.TestCase; | |||
import org.apache.archiva.configuration.ProxyConnectorConfiguration; | |||
import org.apache.commons.lang.StringUtils; | |||
@@ -26,10 +27,8 @@ import java.util.ArrayList; | |||
import java.util.Collections; | |||
import java.util.List; | |||
import junit.framework.TestCase; | |||
/** | |||
* ProxyConnectorConfigurationOrderComparatorTest | |||
* ProxyConnectorConfigurationOrderComparatorTest | |||
* | |||
* @version $Id$ | |||
*/ | |||
@@ -47,7 +46,7 @@ public class ProxyConnectorConfigurationOrderComparatorTest | |||
Collections.sort( proxies, ProxyConnectorConfigurationOrderComparator.getInstance() ); | |||
assertProxyOrder( new String[] { "corporate", "snapshots", "3rdparty", "sandbox" }, proxies ); | |||
assertProxyOrder( new String[]{ "corporate", "snapshots", "3rdparty", "sandbox" }, proxies ); | |||
} | |||
public void testSortNormal() | |||
@@ -61,7 +60,7 @@ public class ProxyConnectorConfigurationOrderComparatorTest | |||
Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() ); | |||
assertProxyOrder( new String[] { "snapshots", "3rdparty", "corporate", "sandbox" }, proxies ); | |||
assertProxyOrder( new String[]{ "snapshots", "3rdparty", "corporate", "sandbox" }, proxies ); | |||
} | |||
public void testSortPartial() | |||
@@ -75,7 +74,7 @@ public class ProxyConnectorConfigurationOrderComparatorTest | |||
Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() ); | |||
assertProxyOrder( new String[] { "3rdparty", "corporate", "snapshots", "sandbox" }, proxies ); | |||
assertProxyOrder( new String[]{ "3rdparty", "corporate", "snapshots", "sandbox" }, proxies ); | |||
} | |||
private void assertProxyOrder( String[] ids, List<ProxyConnectorConfiguration> proxies ) |
@@ -23,7 +23,6 @@ import junit.framework.TestCase; | |||
import org.apache.archiva.configuration.AbstractRepositoryConfiguration; | |||
import org.apache.archiva.configuration.ManagedRepositoryConfiguration; | |||
import java.util.Comparator; | |||
/** |