*/
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();
* @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();
*/
/**
- * ConfigurationEvent
+ * ConfigurationEvent
*
* @version $Id$
*/
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;
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;
/**
* An error in the configuration.
- *
*/
public class InvalidConfigurationException
extends Exception
* 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;
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
private Properties getSubset( Properties props, String prefix )
{
Enumeration keys = props.keys();
* 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$
*/
* 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$
*/
import java.util.Comparator;
/**
- * NetworkProxyComparator
+ * NetworkProxyComparator
*
* @version $Id$
*/
* 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$
*/
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 )
{
return 1;
}
-
+
if ( o1.getOrder() != 0 && o2.getOrder() == 0 )
{
return -1;
* 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
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;
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
{
{
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" ) );
}
}
/**
* Test the generated LegacyArtifactPath class from Modello. This is primarily to test the hand coded methods.
+ *
* @since 1.1
*/
@RunWith( JUnit4.class )
* under the License.
*/
+import junit.framework.TestCase;
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.commons.lang.StringUtils;
import java.util.Collections;
import java.util.List;
-import junit.framework.TestCase;
-
/**
- * ProxyConnectorConfigurationOrderComparatorTest
+ * ProxyConnectorConfigurationOrderComparatorTest
*
* @version $Id$
*/
Collections.sort( proxies, ProxyConnectorConfigurationOrderComparator.getInstance() );
- assertProxyOrder( new String[] { "corporate", "snapshots", "3rdparty", "sandbox" }, proxies );
+ assertProxyOrder( new String[]{ "corporate", "snapshots", "3rdparty", "sandbox" }, proxies );
}
public void testSortNormal()
Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() );
- assertProxyOrder( new String[] { "snapshots", "3rdparty", "corporate", "sandbox" }, proxies );
+ assertProxyOrder( new String[]{ "snapshots", "3rdparty", "corporate", "sandbox" }, proxies );
}
public void testSortPartial()
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 )
import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-
import java.util.Comparator;
/**