<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-policies</artifactId>
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.collections4.CollectionUtils;
+import org.apache.commons.collections4.ListUtils;
+import org.apache.commons.collections4.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.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.collections4.CollectionUtils;
+import org.apache.commons.collections4.Predicate;
import org.apache.commons.configuration.CombinedConfiguration;
import org.apache.tools.ant.types.selectors.SelectorUtils;
import org.springframework.stereotype.Service;
*/
import org.apache.archiva.configuration.FileType;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
import org.apache.commons.lang.StringUtils;
/**
*/
import org.apache.archiva.configuration.FileType;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
import java.util.HashMap;
import java.util.Map;
*/
import org.apache.archiva.configuration.NetworkProxyConfiguration;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
import org.apache.commons.lang.StringUtils;
/**
*/
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
import org.apache.commons.lang.StringUtils;
/**
<artifactId>archiva-repository-layer</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
import org.apache.archiva.consumers.RepositoryContentConsumer;
import org.apache.archiva.repository.ManagedRepository;
import org.apache.archiva.repository.features.IndexCreationFeature;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.tools.ant.types.selectors.SelectorUtils;
}
+ @SuppressWarnings( "deprecation" )
@Test
public void testConsumption()
{
assertFalse( predicate.evaluate( consumer ) );
}
+ @SuppressWarnings( "deprecation" )
@Test
public void testConsumptionOfOtherMetadata()
{
fileType.removePattern( "**/*.xml" );
}
+ @SuppressWarnings( "deprecation" )
private void assertNotConsumed( String path )
throws Exception
{
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
import org.apache.archiva.scheduler.ArchivaTaskScheduler;
import org.apache.archiva.scheduler.repository.model.RepositoryTask;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.SystemUtils;
<artifactId>archiva-repository-layer</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
*/
import org.apache.archiva.admin.model.beans.ProxyConnector;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
import org.apache.commons.lang.StringUtils;
/**
*/
import org.apache.archiva.admin.model.beans.FileType;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
import java.util.HashMap;
import java.util.Map;
import org.apache.archiva.configuration.functors.ProxyConnectorSelectionPredicate;
import org.apache.archiva.metadata.model.facets.AuditEvent;
import org.apache.archiva.repository.RepositoryRegistry;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RemoteRepositoryContent;
import org.apache.archiva.xml.XMLException;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.time.DateUtils;
import org.apache.archiva.model.Plugin;
import org.apache.archiva.xml.XMLException;
import org.apache.archiva.xml.XMLWriter;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
import org.apache.archiva.consumers.RepositoryContentConsumer;
import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure;
import org.apache.archiva.repository.scanner.functors.TriggerBeginScanClosure;
import org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure;
-import org.apache.commons.collections.Closure;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.functors.IfClosure;
+import org.apache.commons.collections4.Closure;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
+import org.apache.commons.collections4.functors.IfClosure;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
}
List<InvalidRepositoryContentConsumer> selectedInvalidConsumers = getSelectedInvalidConsumers();
- CollectionUtils.forAllDo( selectedKnownConsumers, triggerBeginScan );
- CollectionUtils.forAllDo( selectedInvalidConsumers, triggerBeginScan );
+ IterableUtils.forEach( selectedKnownConsumers, triggerBeginScan );
+ IterableUtils.forEach( selectedInvalidConsumers, triggerBeginScan );
// yuck. In case you can't read this, it says
// "process the file if the consumer has it in the includes list, and not in the excludes list"
closure.setBasefile( baseFile );
closure.setExecuteOnEntireRepo( false );
- Closure processIfWanted = IfClosure.getInstance( predicate, closure );
+ Closure processIfWanted = IfClosure.ifClosure( predicate, closure );
- CollectionUtils.forAllDo( selectedKnownConsumers, processIfWanted );
+ IterableUtils.forEach( selectedKnownConsumers, processIfWanted );
if ( predicate.getWantedFileCount() <= 0 )
{
// Nothing known processed this file. It is invalid!
- CollectionUtils.forAllDo( selectedInvalidConsumers, closure );
+ IterableUtils.forEach( selectedInvalidConsumers, closure );
}
TriggerScanCompletedClosure scanCompletedClosure = new TriggerScanCompletedClosure( repository, false );
- CollectionUtils.forAllDo( selectedKnownConsumers, scanCompletedClosure );
+ IterableUtils.forEach( selectedKnownConsumers, scanCompletedClosure );
}
finally
{
/* TODO: This is never called by the repository scanner instance, so not calling here either - but it probably should be?
- CollectionUtils.forAllDo( availableKnownConsumers, triggerCompleteScan );
- CollectionUtils.forAllDo( availableInvalidConsumers, triggerCompleteScan );
+ IterableUtils.forEach( availableKnownConsumers, triggerCompleteScan );
+ IterableUtils.forEach( availableInvalidConsumers, triggerCompleteScan );
*/
releaseSelectedKnownConsumers( selectedKnownConsumers );
}
*/
import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import javax.xml.bind.annotation.XmlRootElement;
import java.text.SimpleDateFormat;
import org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure;
import org.apache.archiva.repository.scanner.functors.TriggerBeginScanClosure;
import org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure;
-import org.apache.commons.collections.Closure;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.functors.IfClosure;
+import org.apache.commons.collections4.Closure;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
+import org.apache.commons.collections4.functors.IfClosure;
import org.apache.commons.lang.SystemUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Closure triggerBeginScan =
new TriggerBeginScanClosure( repository, new Date( System.currentTimeMillis() ), true );
- CollectionUtils.forAllDo( knownConsumerList, triggerBeginScan );
- CollectionUtils.forAllDo( invalidConsumerList, triggerBeginScan );
+ IterableUtils.forEach( knownConsumerList, triggerBeginScan );
+ IterableUtils.forEach( invalidConsumerList, triggerBeginScan );
if ( SystemUtils.IS_OS_WINDOWS )
{
consumerProcessFile.setBasefile( basefile );
consumerWantsFile.setBasefile( basefile );
- Closure processIfWanted = IfClosure.getInstance( consumerWantsFile, consumerProcessFile );
- CollectionUtils.forAllDo( this.knownConsumers, processIfWanted );
+ Closure processIfWanted = IfClosure.ifClosure( consumerWantsFile, consumerProcessFile );
+ IterableUtils.forEach( this.knownConsumers, processIfWanted );
if ( consumerWantsFile.getWantedFileCount() <= 0 )
{
// Nothing known processed this file. It is invalid!
- CollectionUtils.forAllDo( this.invalidConsumers, consumerProcessFile );
+ IterableUtils.forEach( this.invalidConsumers, consumerProcessFile );
}
}
private void finishWalk() {
this.isRunning = false;
TriggerScanCompletedClosure scanCompletedClosure = new TriggerScanCompletedClosure( repository, true );
- CollectionUtils.forAllDo( knownConsumers, scanCompletedClosure );
- CollectionUtils.forAllDo( invalidConsumers, scanCompletedClosure );
+ IterableUtils.forEach( knownConsumers, scanCompletedClosure );
+ IterableUtils.forEach( invalidConsumers, scanCompletedClosure );
stats.setConsumerTimings( consumerTimings );
stats.setConsumerCounts( consumerCounts );
import org.apache.archiva.common.utils.BaseFile;
import org.apache.archiva.consumers.RepositoryContentConsumer;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.archiva.consumers.ConsumerException;
import org.apache.archiva.consumers.RepositoryContentConsumer;
import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.archiva.consumers.RepositoryContentConsumer;
import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<artifactId>archiva-common</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
* under the License.
*/
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
import org.dom4j.Element;
import java.util.ArrayList;
assertTrue( Files.exists(basePath.resolve( ".indexer" )) );
assertTrue( Files.exists(basePath.resolve(".index" )) );
- assertEquals( 1, response.getTotalHits() );
+ assertEquals( 1, response.getTotalHitsCount());
Set<ArtifactInfo> results = response.getResults();
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.services.utils.AddAdminRepoConsumerClosure;
import org.apache.archiva.rest.services.utils.AdminRepositoryConsumerComparator;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
{
AddAdminRepoConsumerClosure addAdminRepoConsumer =
new AddAdminRepoConsumerClosure( archivaAdministration.getKnownContentConsumers() );
- CollectionUtils.forAllDo( repoConsumerUtil.getAvailableKnownConsumers(), addAdminRepoConsumer );
+ IterableUtils.forEach( repoConsumerUtil.getAvailableKnownConsumers(), addAdminRepoConsumer );
List<AdminRepositoryConsumer> knownContentConsumers = addAdminRepoConsumer.getList();
Collections.sort( knownContentConsumers, AdminRepositoryConsumerComparator.getInstance() );
return knownContentConsumers;
{
AddAdminRepoConsumerClosure addAdminRepoConsumer =
new AddAdminRepoConsumerClosure( archivaAdministration.getInvalidContentConsumers() );
- CollectionUtils.forAllDo( repoConsumerUtil.getAvailableInvalidConsumers(), addAdminRepoConsumer );
+ IterableUtils.forEach( repoConsumerUtil.getAvailableInvalidConsumers(), addAdminRepoConsumer );
List<AdminRepositoryConsumer> invalidContentConsumers = addAdminRepoConsumer.getList();
Collections.sort( invalidContentConsumers, AdminRepositoryConsumerComparator.getInstance() );
return invalidContentConsumers;
import org.apache.archiva.rest.services.utils.ArtifactContentEntryComparator;
import org.apache.archiva.security.ArchivaSecurityException;
import org.apache.archiva.xml.XMLException;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.apache.archiva.rest.api.model.StringList;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.api.services.SearchService;
-import org.apache.commons.collections.ListUtils;
+import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.apache.archiva.consumers.RepositoryContentConsumer;
import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
import java.util.ArrayList;
import java.util.List;
import org.apache.archiva.redback.system.check.EnvironmentCheck;
import org.apache.archiva.redback.users.UserManager;
import org.apache.archiva.security.common.ArchivaRoleConstants;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.StopWatch;
import org.slf4j.Logger;
import org.apache.archiva.redback.components.registry.Registry;
import org.apache.archiva.redback.components.registry.RegistryListener;
import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
<properties>
<commons-codec.version>1.6</commons-codec.version>
- <commons-collections.version>3.2.1</commons-collections.version>
+ <commons-collections.version>4.1</commons-collections.version>
<commons-fileupload.version>1.2.2</commons-fileupload.version>
<commons-io.version>2.5</commons-io.version>
<commons-lang.version>2.6</commons-lang.version>
</exclusions>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
<version>${commons-collections.version}</version>
</dependency>
<dependency>