mirror of
https://github.com/apache/archiva.git
synced 2025-02-20 17:04:57 +00:00
use diamond operator
This commit is contained in:
parent
ff99d5a203
commit
d9de8dc7af
@ -24,17 +24,16 @@
|
||||
import org.apache.archiva.admin.model.beans.ManagedRepository;
|
||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
|
||||
import org.apache.archiva.consumers.ConsumerException;
|
||||
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.RepositoryContentConsumer;
|
||||
import org.apache.archiva.converter.RepositoryConversionException;
|
||||
import org.apache.archiva.converter.legacy.LegacyRepositoryConverter;
|
||||
import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
|
||||
import org.apache.archiva.repository.scanner.RepositoryScanner;
|
||||
import org.apache.archiva.repository.scanner.RepositoryScannerException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.archiva.consumers.ConsumerException;
|
||||
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.RepositoryContentConsumer;
|
||||
import org.apache.maven.artifact.manager.WagonManager;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
@ -167,13 +166,13 @@ private void doScan( String path, String[] consumers )
|
||||
repo.setName( "Archiva CLI Provided Repo" );
|
||||
repo.setLocation( path );
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumerList = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumerList = new ArrayList<>();
|
||||
|
||||
knownConsumerList.addAll( getConsumerList( consumers ) );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumerList = Collections.emptyList();
|
||||
|
||||
List<String> ignoredContent = new ArrayList<String>();
|
||||
List<String> ignoredContent = new ArrayList<>();
|
||||
ignoredContent.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) );
|
||||
|
||||
RepositoryScanner scanner = lookup( RepositoryScanner.class );
|
||||
@ -201,7 +200,7 @@ private <T>T lookup( Class<T> clazz )
|
||||
private List<KnownRepositoryContentConsumer> getConsumerList( String[] consumers )
|
||||
throws ConsumerException, PlexusSisuBridgeException
|
||||
{
|
||||
List<KnownRepositoryContentConsumer> consumerList = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> consumerList = new ArrayList<>();
|
||||
|
||||
Map<String, KnownRepositoryContentConsumer> availableConsumers = getConsumers();
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class ArtifactCountConsumer
|
||||
public ArtifactCountConsumer()
|
||||
{
|
||||
// TODO: shouldn't this use filetypes?
|
||||
includes = new ArrayList<String>();
|
||||
includes = new ArrayList<>();
|
||||
includes.add( "**/*.pom" );
|
||||
includes.add( "**/*.jar" );
|
||||
includes.add( "**/*.war" );
|
||||
|
@ -82,29 +82,14 @@ public class LegacyToDefaultConverter
|
||||
@Inject
|
||||
private DigesterUtils digesterUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private ModelConverter translator;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private ArtifactFactory artifactFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private ArtifactHandlerManager artifactHandlerManager;
|
||||
|
||||
/**
|
||||
* default-value="false"
|
||||
*/
|
||||
private boolean force;
|
||||
|
||||
/**
|
||||
* default-value="false"
|
||||
*/
|
||||
private boolean dryrun;
|
||||
|
||||
private Map<Artifact, List<String>> warnings = new HashMap<Artifact, List<String>>();
|
||||
@ -686,7 +671,7 @@ private void addWarning( Artifact artifact, String message )
|
||||
List<String> messages = warnings.get( artifact );
|
||||
if ( messages == null )
|
||||
{
|
||||
messages = new ArrayList<String>( 1 );
|
||||
messages = new ArrayList<>( 1 );
|
||||
}
|
||||
messages.add( message );
|
||||
warnings.put( artifact, messages );
|
||||
|
@ -813,7 +813,7 @@ public void testMultipleArtifacts()
|
||||
{
|
||||
// test multiple artifacts are converted
|
||||
|
||||
List<Artifact> artifacts = new ArrayList<Artifact>();
|
||||
List<Artifact> artifacts = new ArrayList<>();
|
||||
artifacts.add( createArtifact( "test", "artifact-one", "1.0.0" ) );
|
||||
artifacts.add( createArtifact( "test", "artifact-two", "1.0.0" ) );
|
||||
artifacts.add( createArtifact( "test", "artifact-three", "1.0.0" ) );
|
||||
|
@ -20,14 +20,12 @@
|
||||
*/
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -143,7 +141,7 @@ public boolean isValidChecksums( ChecksumAlgorithm algorithms[] )
|
||||
|
||||
try (FileInputStream fis = new FileInputStream( referenceFile ))
|
||||
{
|
||||
List<Checksum> checksums = new ArrayList<Checksum>( algorithms.length );
|
||||
List<Checksum> checksums = new ArrayList<>( algorithms.length );
|
||||
// Create checksum object for each algorithm.
|
||||
for ( ChecksumAlgorithm checksumAlgorithm : algorithms )
|
||||
{
|
||||
@ -215,7 +213,7 @@ public boolean isValidChecksums( ChecksumAlgorithm algorithms[] )
|
||||
*/
|
||||
public boolean fixChecksums( ChecksumAlgorithm[] algorithms )
|
||||
{
|
||||
List<Checksum> checksums = new ArrayList<Checksum>( algorithms.length );
|
||||
List<Checksum> checksums = new ArrayList<>( algorithms.length );
|
||||
// Create checksum object for each algorithm.
|
||||
for ( ChecksumAlgorithm checksumAlgorithm : algorithms )
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ public void testUpdateMany()
|
||||
{
|
||||
Checksum checksumSha1 = new Checksum( ChecksumAlgorithm.SHA1 );
|
||||
Checksum checksumMd5 = new Checksum( ChecksumAlgorithm.MD5 );
|
||||
List<Checksum> checksums = new ArrayList<Checksum>();
|
||||
List<Checksum> checksums = new ArrayList<>();
|
||||
checksums.add( checksumSha1 );
|
||||
checksums.add( checksumMd5 );
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class VersionComparator
|
||||
|
||||
public VersionComparator()
|
||||
{
|
||||
specialWords = new ArrayList<String>( 23 );
|
||||
specialWords = new ArrayList<>( 23 );
|
||||
|
||||
// ids that refer to LATEST
|
||||
specialWords.add( "final" );
|
||||
@ -204,7 +204,7 @@ public static String[] toParts( String version )
|
||||
int modeDigit = 1;
|
||||
int modeText = 2;
|
||||
|
||||
List<String> parts = new ArrayList<String>();
|
||||
List<String> parts = new ArrayList<>();
|
||||
int len = version.length();
|
||||
int i = 0;
|
||||
int start = 0;
|
||||
|
@ -19,13 +19,13 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* VersionComparatorTest
|
||||
*
|
||||
@ -97,7 +97,7 @@ public void testComparator()
|
||||
|
||||
private void assertSort( String[] rawVersions, String[] expectedSort )
|
||||
{
|
||||
List<String> versions = new ArrayList<String>();
|
||||
List<String> versions = new ArrayList<>();
|
||||
versions.addAll( Arrays.asList( rawVersions ) );
|
||||
|
||||
Collections.sort( versions, VersionComparator.getInstance() );
|
||||
|
@ -270,7 +270,7 @@ else if ( StringUtils.isEmpty( r.getUrl() ) )
|
||||
|
||||
// Create a copy of the list to read from (to prevent concurrent modification exceptions)
|
||||
List<ProxyConnectorConfiguration> proxyConnectorList =
|
||||
new ArrayList<ProxyConnectorConfiguration>( config.getProxyConnectors() );
|
||||
new ArrayList<>( config.getProxyConnectors() );
|
||||
// Remove the old connector list.
|
||||
config.getProxyConnectors().clear();
|
||||
|
||||
@ -727,7 +727,7 @@ private void handleUpgradeConfiguration()
|
||||
{
|
||||
|
||||
List<String> knowContentConsumers =
|
||||
new ArrayList<String>( configuration.getRepositoryScanning().getKnownContentConsumers().size() );
|
||||
new ArrayList<>( configuration.getRepositoryScanning().getKnownContentConsumers().size() );
|
||||
for ( String knowContentConsumer : configuration.getRepositoryScanning().getKnownContentConsumers() )
|
||||
{
|
||||
if ( !dbConsumers.contains( knowContentConsumer ) )
|
||||
@ -743,7 +743,7 @@ private void handleUpgradeConfiguration()
|
||||
if ( !configuration.getRepositoryScanning().getKnownContentConsumers().contains( "create-archiva-metadata" ) )
|
||||
{
|
||||
List<String> knowContentConsumers =
|
||||
new ArrayList<String>( configuration.getRepositoryScanning().getKnownContentConsumers() );
|
||||
new ArrayList<>( configuration.getRepositoryScanning().getKnownContentConsumers() );
|
||||
knowContentConsumers.add( "create-archiva-metadata" );
|
||||
configuration.getRepositoryScanning().setKnownContentConsumers( knowContentConsumers );
|
||||
}
|
||||
@ -752,7 +752,7 @@ private void handleUpgradeConfiguration()
|
||||
if ( !configuration.getRepositoryScanning().getKnownContentConsumers().contains( "duplicate-artifacts" ) )
|
||||
{
|
||||
List<String> knowContentConsumers =
|
||||
new ArrayList<String>( configuration.getRepositoryScanning().getKnownContentConsumers() );
|
||||
new ArrayList<>( configuration.getRepositoryScanning().getKnownContentConsumers() );
|
||||
knowContentConsumers.add( "duplicate-artifacts" );
|
||||
configuration.getRepositoryScanning().setKnownContentConsumers( knowContentConsumers );
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ private void initialiseTypeMap( Configuration configuration )
|
||||
List<String> patterns = defaultTypeMap.get( filetype.getId() );
|
||||
if ( patterns == null )
|
||||
{
|
||||
patterns = new ArrayList<String>( filetype.getPatterns().size() );
|
||||
patterns = new ArrayList<>( filetype.getPatterns().size() );
|
||||
}
|
||||
patterns.addAll( filetype.getPatterns() );
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class ProxyConnectorConfigurationOrderComparatorTest
|
||||
@Test
|
||||
public void testSortOfAllZeros()
|
||||
{
|
||||
List<ProxyConnectorConfiguration> proxies = new ArrayList<ProxyConnectorConfiguration>();
|
||||
List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
|
||||
|
||||
proxies.add( createConnector( "corporate", 0 ) );
|
||||
proxies.add( createConnector( "snapshots", 0 ) );
|
||||
@ -55,7 +55,7 @@ public void testSortOfAllZeros()
|
||||
@Test
|
||||
public void testSortNormal()
|
||||
{
|
||||
List<ProxyConnectorConfiguration> proxies = new ArrayList<ProxyConnectorConfiguration>();
|
||||
List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
|
||||
|
||||
proxies.add( createConnector( "corporate", 3 ) );
|
||||
proxies.add( createConnector( "snapshots", 1 ) );
|
||||
@ -70,7 +70,7 @@ public void testSortNormal()
|
||||
@Test
|
||||
public void testSortPartial()
|
||||
{
|
||||
List<ProxyConnectorConfiguration> proxies = new ArrayList<ProxyConnectorConfiguration>();
|
||||
List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
|
||||
|
||||
proxies.add( createConnector( "corporate", 3 ) );
|
||||
proxies.add( createConnector( "snapshots", 0 ) );
|
||||
|
@ -70,7 +70,7 @@ public class ArtifactMissingChecksumsConsumer
|
||||
|
||||
private File repositoryDir;
|
||||
|
||||
private List<String> includes = new ArrayList<String>( 0 );
|
||||
private List<String> includes = new ArrayList<>( 0 );
|
||||
|
||||
@Inject
|
||||
public ArtifactMissingChecksumsConsumer( ArchivaConfiguration configuration, FileTypes filetypes )
|
||||
|
@ -73,7 +73,7 @@ public class AutoRemoveConsumer
|
||||
|
||||
private File repositoryDir;
|
||||
|
||||
private List<String> includes = new ArrayList<String>( 0 );
|
||||
private List<String> includes = new ArrayList<>( 0 );
|
||||
|
||||
public String getId()
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ public class AutoRenameConsumer
|
||||
|
||||
private File repositoryDir;
|
||||
|
||||
private List<String> includes = new ArrayList<String>( 3 );
|
||||
private List<String> includes = new ArrayList<>( 3 );
|
||||
|
||||
private Map<String, String> extensionRenameMap = new HashMap<String, String>();
|
||||
|
||||
|
@ -109,7 +109,7 @@ public class MetadataUpdaterConsumer
|
||||
|
||||
private File repositoryDir;
|
||||
|
||||
private List<String> includes = new ArrayList<String>( 0 );
|
||||
private List<String> includes = new ArrayList<>( 0 );
|
||||
|
||||
private long scanStartTimestamp = 0;
|
||||
|
||||
|
@ -174,8 +174,8 @@ public void initialize()
|
||||
throws PlexusSisuBridgeException
|
||||
{
|
||||
checksum = plexusSisuBridge.lookup( ChecksumFile.class );
|
||||
List<Digester> allDigesters = new ArrayList<Digester>( digesterUtils.getAllDigesters() );
|
||||
includes = new ArrayList<String>( allDigesters.size() );
|
||||
List<Digester> allDigesters = new ArrayList<>( digesterUtils.getAllDigesters() );
|
||||
includes = new ArrayList<>( allDigesters.size() );
|
||||
for ( Digester digester : allDigesters )
|
||||
{
|
||||
includes.add( "**/*" + digester.getFilenameExtension() );
|
||||
|
@ -112,7 +112,7 @@ public void process( String path )
|
||||
reference.setArtifactId( artifactRef.getArtifactId() );
|
||||
|
||||
// Gether the released versions
|
||||
List<String> releasedVersions = new ArrayList<String>();
|
||||
List<String> releasedVersions = new ArrayList<>();
|
||||
|
||||
List<ManagedRepository> repos = managedRepositoryAdmin.getManagedRepositories();
|
||||
for ( ManagedRepository repo : repos )
|
||||
|
@ -86,7 +86,7 @@ public void process( String path )
|
||||
reference.setArtifactId( artifact.getArtifactId() );
|
||||
reference.setVersion( artifact.getVersion() );
|
||||
|
||||
List<String> versions = new ArrayList<String>( repository.getVersions( reference ) );
|
||||
List<String> versions = new ArrayList<>( repository.getVersions( reference ) );
|
||||
|
||||
Collections.sort( versions, VersionComparator.getInstance() );
|
||||
|
||||
|
@ -68,9 +68,6 @@ public class RepositoryPurgeConsumer
|
||||
*/
|
||||
private String description = "Purge repository of old snapshots";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Inject
|
||||
@Named( value = "archivaConfiguration#default" )
|
||||
private ArchivaConfiguration configuration;
|
||||
@ -78,27 +75,18 @@ public class RepositoryPurgeConsumer
|
||||
@Inject
|
||||
private ManagedRepositoryAdmin managedRepositoryAdmin;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Inject
|
||||
@Named( value = "repositoryContentFactory#default" )
|
||||
private RepositoryContentFactory repositoryContentFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Inject
|
||||
private MetadataTools metadataTools;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Inject
|
||||
@Named( value = "fileTypes" )
|
||||
private FileTypes filetypes;
|
||||
|
||||
private List<String> includes = new ArrayList<String>();
|
||||
private List<String> includes = new ArrayList<>();
|
||||
|
||||
private RepositoryPurge repoPurge;
|
||||
|
||||
|
@ -71,7 +71,7 @@ public void process( String path )
|
||||
reference.setArtifactId( artifact.getArtifactId() );
|
||||
reference.setVersion( artifact.getVersion() );
|
||||
|
||||
List<String> versions = new ArrayList<String>( repository.getVersions( reference ) );
|
||||
List<String> versions = new ArrayList<>( repository.getVersions( reference ) );
|
||||
|
||||
Collections.sort( versions, VersionComparator.getInstance() );
|
||||
|
||||
|
@ -76,7 +76,7 @@ public class NexusIndexerConsumer
|
||||
|
||||
private NexusIndexer nexusIndexer;
|
||||
|
||||
private List<String> includes = new ArrayList<String>( 0 );
|
||||
private List<String> includes = new ArrayList<>( 0 );
|
||||
|
||||
private ManagedRepository repository;
|
||||
|
||||
|
@ -62,29 +62,19 @@ public class ArchivaMetadataCreationConsumer
|
||||
extends AbstractMonitoredConsumer
|
||||
implements KnownRepositoryContentConsumer, RegistryListener
|
||||
{
|
||||
/**
|
||||
* default-value="create-archiva-metadata"
|
||||
*/
|
||||
private String id = "create-archiva-metadata";
|
||||
|
||||
/**
|
||||
* default-value="Create basic metadata for Archiva to be able to reference the artifact"
|
||||
*/
|
||||
private String description = "Create basic metadata for Archiva to be able to reference the artifact";
|
||||
|
||||
/**
|
||||
*/
|
||||
@Inject
|
||||
private ArchivaConfiguration configuration;
|
||||
|
||||
/**
|
||||
*/
|
||||
@Inject
|
||||
private FileTypes filetypes;
|
||||
|
||||
private Date whenGathered;
|
||||
|
||||
private List<String> includes = new ArrayList<String>( 0 );
|
||||
private List<String> includes = new ArrayList<>( 0 );
|
||||
|
||||
/**
|
||||
* FIXME: this could be multiple implementations and needs to be configured.
|
||||
|
@ -101,7 +101,7 @@ public void convertLegacyRepository( File legacyRepositoryDirectory, File reposi
|
||||
legacyConverterConsumer.setExcludes( fileExclusionPatterns );
|
||||
legacyConverterConsumer.setDestinationRepository( repository );
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>( 1 );
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>( 1 );
|
||||
knownConsumers.add( legacyConverterConsumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = Collections.emptyList();
|
||||
|
@ -81,7 +81,7 @@ public class LegacyConverterArtifactConsumer
|
||||
public LegacyConverterArtifactConsumer( PlexusSisuBridge plexusSisuBridge )
|
||||
throws PlexusSisuBridgeException
|
||||
{
|
||||
includes = new ArrayList<String>( 3 );
|
||||
includes = new ArrayList<>( 3 );
|
||||
includes.add( "**/*.jar" );
|
||||
includes.add( "**/*.ear" );
|
||||
includes.add( "**/*.war" );
|
||||
|
@ -154,7 +154,7 @@ public void testLegacyConversion()
|
||||
{
|
||||
File legacyRepoDir = new File( sourceRepository.getBasedir() );
|
||||
File destRepoDir = new File( targetRepository.getLocation() );
|
||||
List<String> excludes = new ArrayList<String>();
|
||||
List<String> excludes = new ArrayList<>();
|
||||
repositoryConverter.convertLegacyRepository( legacyRepoDir, destRepoDir, excludes );
|
||||
}
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ private SearchResults search( SearchResultLimits limits, BooleanQuery q, List<St
|
||||
|
||||
private List<IndexingContext> getIndexingContexts( List<String> ids )
|
||||
{
|
||||
List<IndexingContext> contexts = new ArrayList<IndexingContext>( ids.size() );
|
||||
List<IndexingContext> contexts = new ArrayList<>( ids.size() );
|
||||
|
||||
for ( String id : ids )
|
||||
{
|
||||
@ -363,7 +363,7 @@ private List<String> addIndexingContexts( List<String> selectedRepos )
|
||||
}
|
||||
}
|
||||
|
||||
return new ArrayList<String>( indexingContextIds );
|
||||
return new ArrayList<>( indexingContextIds );
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class SearchFields
|
||||
/**
|
||||
* repositories
|
||||
*/
|
||||
private List<String> repositories = new ArrayList<String>();
|
||||
private List<String> repositories = new ArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
|
@ -42,7 +42,7 @@ public class SearchResultHit
|
||||
|
||||
private String repositoryId = "";
|
||||
|
||||
private List<String> versions = new ArrayList<String>();
|
||||
private List<String> versions = new ArrayList<>();
|
||||
|
||||
private String packaging;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public void addHit( String id, SearchResultHit hit )
|
||||
*/
|
||||
public List<SearchResultHit> getHits()
|
||||
{
|
||||
return new ArrayList<SearchResultHit>( hits.values() );
|
||||
return new ArrayList<>( hits.values() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,7 +46,7 @@ public class MavenRepositorySearchTest
|
||||
private void createSimpleIndex( boolean scan )
|
||||
throws Exception
|
||||
{
|
||||
List<File> files = new ArrayList<File>();
|
||||
List<File> files = new ArrayList<>();
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1
|
||||
+ "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1
|
||||
@ -60,7 +60,7 @@ private void createSimpleIndex( boolean scan )
|
||||
private void createIndexContainingMoreArtifacts( boolean scan )
|
||||
throws Exception
|
||||
{
|
||||
List<File> files = new ArrayList<File>();
|
||||
List<File> files = new ArrayList<>();
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1
|
||||
+ "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1
|
||||
@ -82,7 +82,7 @@ private void createIndexContainingMoreArtifacts( boolean scan )
|
||||
private void createIndexContainingMultipleArtifactsSameVersion( boolean scan )
|
||||
throws Exception
|
||||
{
|
||||
List<File> files = new ArrayList<File>();
|
||||
List<File> files = new ArrayList<>();
|
||||
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1
|
||||
+ "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
|
||||
@ -188,7 +188,7 @@ public void testQuickSearchMultipleArtifactsSameVersion()
|
||||
{
|
||||
createIndexContainingMultipleArtifactsSameVersion( false );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
// search artifactId
|
||||
@ -218,7 +218,7 @@ public void testMultipleArtifactsSameVersionWithClassifier()
|
||||
{
|
||||
createIndexContainingMultipleArtifactsSameVersion( true );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
// search artifactId
|
||||
@ -255,7 +255,7 @@ public void testQuickSearchWithMultipleKeywords()
|
||||
{
|
||||
createSimpleIndex( false );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 );
|
||||
@ -275,7 +275,7 @@ public void testQuickSearchWithPagination()
|
||||
{
|
||||
createSimpleIndex( true );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
// page 1
|
||||
@ -324,14 +324,14 @@ public void testArtifactFoundInMultipleRepositories()
|
||||
{
|
||||
createSimpleIndex( true );
|
||||
|
||||
List<File> files = new ArrayList<File>();
|
||||
List<File> files = new ArrayList<>();
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_2
|
||||
+ "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_2
|
||||
+ "/org/apache/archiva/archiva-search/1.1/archiva-search-1.1.jar" ) );
|
||||
createIndex( TEST_REPO_2, files, false );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
selectedRepos.add( TEST_REPO_2 );
|
||||
|
||||
@ -369,7 +369,7 @@ public void testNoMatchFound()
|
||||
{
|
||||
createSimpleIndex( false );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 );
|
||||
@ -388,7 +388,7 @@ public void testNoMatchFound()
|
||||
public void testNoIndexFound()
|
||||
throws Exception
|
||||
{
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 );
|
||||
@ -406,7 +406,7 @@ public void testNoIndexFound()
|
||||
public void testRepositoryNotFound()
|
||||
throws Exception
|
||||
{
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( "non-existing-repo" );
|
||||
|
||||
EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 );
|
||||
@ -426,10 +426,10 @@ public void testSearchWithinSearchResults()
|
||||
{
|
||||
createSimpleIndex( true );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
List<String> previousSearchTerms = new ArrayList<String>();
|
||||
List<String> previousSearchTerms = new ArrayList<>();
|
||||
previousSearchTerms.add( "archiva-test" );
|
||||
|
||||
EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 );
|
||||
@ -455,14 +455,14 @@ public void testSearchWithinSearchResults()
|
||||
public void testAdvancedSearch()
|
||||
throws Exception
|
||||
{
|
||||
List<File> files = new ArrayList<File>();
|
||||
List<File> files = new ArrayList<>();
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_2
|
||||
+ "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_2
|
||||
+ "/org/apache/archiva/archiva-search/1.1/archiva-search-1.1.jar" ) );
|
||||
createIndex( TEST_REPO_2, files, false );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_2 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
@ -493,7 +493,7 @@ public void testAdvancedSearchWithPagination()
|
||||
{
|
||||
createIndexContainingMoreArtifacts( false );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
@ -541,14 +541,14 @@ public void testAdvancedSearchWithPagination()
|
||||
public void testAdvancedSearchArtifactIdHasNumericChar()
|
||||
throws Exception
|
||||
{
|
||||
List<File> files = new ArrayList<File>();
|
||||
List<File> files = new ArrayList<>();
|
||||
files.add( new File( FileUtil.getBasedir(),
|
||||
"src/test/" + TEST_REPO_1 + "/com/artifactid-numeric/1.0/artifactid-numeric-1.0.jar" ) );
|
||||
files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1
|
||||
+ "/com/artifactid-numeric123/1.0/artifactid-numeric123-1.0.jar" ) );
|
||||
createIndex( TEST_REPO_1, files, true );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
@ -590,7 +590,7 @@ public void testAdvancedSearchNoRepositoriesConfigured()
|
||||
public void testAdvancedSearchSearchFieldsAreNull()
|
||||
throws Exception
|
||||
{
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
@ -618,7 +618,7 @@ public void testAdvancedSearchSearchFieldsAreNull()
|
||||
public void testAdvancedSearchSearchFieldsAreBlank()
|
||||
throws Exception
|
||||
{
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
@ -654,7 +654,7 @@ public void testAdvancedSearchAllSearchCriteriaSpecified()
|
||||
{
|
||||
createSimpleIndex( true );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
@ -689,7 +689,7 @@ public void testAdvancedSearchJarArtifacts()
|
||||
{
|
||||
createIndexContainingMoreArtifacts( true );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
@ -714,7 +714,7 @@ public void testAdvancedSearchWithIncorrectPackaging()
|
||||
{
|
||||
createSimpleIndex( true );
|
||||
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
@ -768,7 +768,7 @@ public void testAdvancedSearchClassname()
|
||||
public void testAdvancedSearchNoIndexFound()
|
||||
throws Exception
|
||||
{
|
||||
List<String> selectedRepos = new ArrayList<String>();
|
||||
List<String> selectedRepos = new ArrayList<>();
|
||||
selectedRepos.add( TEST_REPO_1 );
|
||||
|
||||
SearchFields searchFields = new SearchFields();
|
||||
|
@ -34,7 +34,7 @@ public class TreeEntry
|
||||
implements Serializable
|
||||
{
|
||||
|
||||
private List<TreeEntry> childs = new ArrayList<TreeEntry>();
|
||||
private List<TreeEntry> childs = new ArrayList<>();
|
||||
|
||||
private Artifact artifact;
|
||||
|
||||
|
@ -109,7 +109,7 @@ public static List<ArtifactReference> cloneArtifactReferences( List<ArtifactRefe
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ArtifactReference> ret = new ArrayList<ArtifactReference>( artifactReferenceList.size() );
|
||||
List<ArtifactReference> ret = new ArrayList<>( artifactReferenceList.size() );
|
||||
|
||||
for ( ArtifactReference ref : artifactReferenceList )
|
||||
{
|
||||
@ -126,7 +126,7 @@ private static List<String> cloneSimpleStringList( List<String> simple )
|
||||
return null;
|
||||
}
|
||||
|
||||
List<String> ret = new ArrayList<String>( simple.size() );
|
||||
List<String> ret = new ArrayList<>( simple.size() );
|
||||
|
||||
for ( String txt : simple )
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ public abstract class AbstractUpdatePolicy
|
||||
*/
|
||||
public static final String ONCE = "once";
|
||||
|
||||
private List<String> options = new ArrayList<String>( 5 );
|
||||
private List<String> options = new ArrayList<>( 5 );
|
||||
|
||||
public AbstractUpdatePolicy()
|
||||
{
|
||||
|
@ -52,13 +52,10 @@ public class CachedFailuresPolicy
|
||||
*/
|
||||
public static final String YES = "yes";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Inject
|
||||
private UrlFailureCache urlFailureCache;
|
||||
|
||||
private List<String> options = new ArrayList<String>( 2 );
|
||||
private List<String> options = new ArrayList<>( 2 );
|
||||
|
||||
public CachedFailuresPolicy()
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ public class ChecksumPolicy
|
||||
|
||||
private ChecksumAlgorithm[] algorithms = new ChecksumAlgorithm[]{ ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 };
|
||||
|
||||
private List<String> options = new ArrayList<String>( 3 );
|
||||
private List<String> options = new ArrayList<>( 3 );
|
||||
|
||||
public ChecksumPolicy()
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ public class PropagateErrorsDownloadPolicy
|
||||
*/
|
||||
public static final String IGNORE = "ignore";
|
||||
|
||||
private List<String> options = new ArrayList<String>( 3 );
|
||||
private List<String> options = new ArrayList<>( 3 );
|
||||
|
||||
public PropagateErrorsDownloadPolicy()
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ public class PropagateErrorsOnUpdateDownloadPolicy
|
||||
*/
|
||||
public static final String NOT_PRESENT = "artifact not already present";
|
||||
|
||||
private List<String> options = new ArrayList<String>( 2 );
|
||||
private List<String> options = new ArrayList<>( 2 );
|
||||
|
||||
public PropagateErrorsOnUpdateDownloadPolicy()
|
||||
{
|
||||
|
@ -193,7 +193,7 @@ private void initConnectorsAndNetworkProxies()
|
||||
connector.setDisabled( proxyConfig.isDisabled() );
|
||||
|
||||
// Copy any blacklist patterns.
|
||||
List<String> blacklist = new ArrayList<String>( 0 );
|
||||
List<String> blacklist = new ArrayList<>( 0 );
|
||||
if ( CollectionUtils.isNotEmpty( proxyConfig.getBlackListPatterns() ) )
|
||||
{
|
||||
blacklist.addAll( proxyConfig.getBlackListPatterns() );
|
||||
@ -201,7 +201,7 @@ private void initConnectorsAndNetworkProxies()
|
||||
connector.setBlacklist( blacklist );
|
||||
|
||||
// Copy any whitelist patterns.
|
||||
List<String> whitelist = new ArrayList<String>( 0 );
|
||||
List<String> whitelist = new ArrayList<>( 0 );
|
||||
if ( CollectionUtils.isNotEmpty( proxyConfig.getWhiteListPatterns() ) )
|
||||
{
|
||||
whitelist.addAll( proxyConfig.getWhiteListPatterns() );
|
||||
@ -236,7 +236,7 @@ private void initConnectorsAndNetworkProxies()
|
||||
if ( connectors == null )
|
||||
{
|
||||
// Create if we are the first.
|
||||
connectors = new ArrayList<ProxyConnector>( 1 );
|
||||
connectors = new ArrayList<>( 1 );
|
||||
}
|
||||
|
||||
// Add the connector.
|
||||
@ -285,7 +285,7 @@ private List<ProxyConnectorRuleConfiguration> findProxyConnectorRules( String so
|
||||
List<ProxyConnectorRuleConfiguration> all )
|
||||
{
|
||||
List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations =
|
||||
new ArrayList<ProxyConnectorRuleConfiguration>();
|
||||
new ArrayList<>();
|
||||
|
||||
for ( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : all )
|
||||
{
|
||||
|
@ -144,9 +144,9 @@ public void setUp()
|
||||
config =
|
||||
(MockConfiguration) applicationContext.getBean( "archivaConfiguration#mock", ArchivaConfiguration.class );
|
||||
|
||||
config.getConfiguration().setManagedRepositories( new ArrayList<ManagedRepositoryConfiguration>() );
|
||||
config.getConfiguration().setRemoteRepositories( new ArrayList<RemoteRepositoryConfiguration>() );
|
||||
config.getConfiguration().setProxyConnectors( new ArrayList<ProxyConnectorConfiguration>() );
|
||||
config.getConfiguration().setManagedRepositories( new ArrayList<>() );
|
||||
config.getConfiguration().setRemoteRepositories( new ArrayList<>() );
|
||||
config.getConfiguration().setProxyConnectors( new ArrayList<>() );
|
||||
|
||||
// Setup source repository (using default layout)
|
||||
String name = getClass().getSimpleName();
|
||||
|
@ -186,7 +186,7 @@ public void testGetProjectMetadataNotProxiedNotLocal()
|
||||
String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/maven-metadata.xml";
|
||||
setupTestableManagedRepository( requestedResource );
|
||||
|
||||
config.getConfiguration().setProxyConnectors( new ArrayList<ProxyConnectorConfiguration>( ) );
|
||||
config.getConfiguration().setProxyConnectors( new ArrayList<>( ) );
|
||||
|
||||
assertResourceNotFound( requestedResource );
|
||||
|
||||
@ -206,7 +206,7 @@ public void testGetProjectMetadataNotProxiedOnLocal()
|
||||
String requestedResource = "org/apache/maven/test/get-project-metadata/maven-metadata.xml";
|
||||
setupTestableManagedRepository( requestedResource );
|
||||
|
||||
config.getConfiguration().setProxyConnectors( new ArrayList<ProxyConnectorConfiguration>( ) );
|
||||
config.getConfiguration().setProxyConnectors( new ArrayList<>( ) );
|
||||
|
||||
assertResourceExists( requestedResource );
|
||||
|
||||
@ -333,7 +333,7 @@ public void testGetProjectMetadataProxiedOnLocalNotRemote()
|
||||
setupTestableManagedRepository( requestedResource );
|
||||
|
||||
|
||||
config.getConfiguration().setProxyConnectors( new ArrayList<ProxyConnectorConfiguration>( ) );
|
||||
config.getConfiguration().setProxyConnectors( new ArrayList<>( ) );
|
||||
// Configure Connector (usually done within archiva.xml configuration)
|
||||
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
|
||||
SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
|
||||
|
@ -142,7 +142,7 @@ public List<String> getBlackListPatterns()
|
||||
{
|
||||
if ( this.blackListPatterns == null )
|
||||
{
|
||||
this.blackListPatterns = new ArrayList<String>( 0 );
|
||||
this.blackListPatterns = new ArrayList<>( 0 );
|
||||
}
|
||||
|
||||
return this.blackListPatterns;
|
||||
@ -217,7 +217,7 @@ public List<String> getWhiteListPatterns()
|
||||
{
|
||||
if ( this.whiteListPatterns == null )
|
||||
{
|
||||
this.whiteListPatterns = new ArrayList<String>( 0 );
|
||||
this.whiteListPatterns = new ArrayList<>( 0 );
|
||||
}
|
||||
|
||||
return this.whiteListPatterns;
|
||||
@ -365,7 +365,7 @@ public String getPolicy( String policyId, String defaultValue )
|
||||
|
||||
public List<PropertyEntry> getPoliciesEntries()
|
||||
{
|
||||
policiesEntries = new ArrayList<PropertyEntry>( getPolicies().size() );
|
||||
policiesEntries = new ArrayList<>( getPolicies().size() );
|
||||
for ( Map.Entry<String, String> entry : getPolicies().entrySet() )
|
||||
{
|
||||
policiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
|
||||
@ -383,7 +383,7 @@ public void setPoliciesEntries( List<PropertyEntry> policiesEntries )
|
||||
|
||||
public List<PropertyEntry> getPropertiesEntries()
|
||||
{
|
||||
propertiesEntries = new ArrayList<PropertyEntry>( getProperties().size() );
|
||||
propertiesEntries = new ArrayList<>( getProperties().size() );
|
||||
for ( Map.Entry<String, String> entry : getProperties().entrySet() )
|
||||
{
|
||||
propertiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
|
||||
|
@ -66,7 +66,7 @@ public List<String> getPatterns()
|
||||
{
|
||||
if ( patterns == null )
|
||||
{
|
||||
this.patterns = new ArrayList<String>( 0 );
|
||||
this.patterns = new ArrayList<>( 0 );
|
||||
}
|
||||
return patterns;
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ public void setBindAuthenticatorEnabled( boolean bindAuthenticatorEnabled )
|
||||
|
||||
public List<PropertyEntry> getExtraPropertiesEntries()
|
||||
{
|
||||
extraPropertiesEntries = new ArrayList<PropertyEntry>( getExtraProperties().size() );
|
||||
extraPropertiesEntries = new ArrayList<>( getExtraProperties().size() );
|
||||
for ( Map.Entry<String, String> entry : getExtraProperties().entrySet() )
|
||||
{
|
||||
extraPropertiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
|
||||
|
@ -75,7 +75,7 @@ public List<ProxyConnector> getProxyConnectors()
|
||||
{
|
||||
if ( this.proxyConnectors == null )
|
||||
{
|
||||
this.proxyConnectors = new ArrayList<ProxyConnector>();
|
||||
this.proxyConnectors = new ArrayList<>();
|
||||
}
|
||||
return proxyConnectors;
|
||||
}
|
||||
|
@ -38,12 +38,12 @@ public class RedbackRuntimeConfiguration
|
||||
/**
|
||||
* Field userManagerImpls.
|
||||
*/
|
||||
private List<String> userManagerImpls = new ArrayList<String>();
|
||||
private List<String> userManagerImpls = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Field rbacManagerImpls.
|
||||
*/
|
||||
private java.util.List<String> rbacManagerImpls = new ArrayList<String>();
|
||||
private java.util.List<String> rbacManagerImpls = new ArrayList<>();
|
||||
|
||||
private LdapConfiguration ldapConfiguration;
|
||||
|
||||
|
@ -249,7 +249,7 @@ public void addExtraParameter( String key, String value )
|
||||
|
||||
public List<PropertyEntry> getExtraParametersEntries()
|
||||
{
|
||||
this.extraParametersEntries = new ArrayList<PropertyEntry>();
|
||||
this.extraParametersEntries = new ArrayList<>();
|
||||
for ( Map.Entry<String, String> entry : getExtraParameters().entrySet() )
|
||||
{
|
||||
this.extraParametersEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
|
||||
@ -292,7 +292,7 @@ public void addExtraHeader( String key, String value )
|
||||
|
||||
public List<PropertyEntry> getExtraHeadersEntries()
|
||||
{
|
||||
this.extraHeadersEntries = new ArrayList<PropertyEntry>();
|
||||
this.extraHeadersEntries = new ArrayList<>();
|
||||
for ( Map.Entry<String, String> entry : getExtraHeaders().entrySet() )
|
||||
{
|
||||
this.extraHeadersEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
|
||||
|
@ -97,7 +97,7 @@ public List<String> getRepositories()
|
||||
{
|
||||
if ( this.repositories == null )
|
||||
{
|
||||
this.repositories = new ArrayList<String>( 0 );
|
||||
this.repositories = new ArrayList<>( 0 );
|
||||
}
|
||||
|
||||
return this.repositories;
|
||||
|
@ -47,8 +47,7 @@ public abstract class AbstractRepositoryAdmin
|
||||
protected Logger log = LoggerFactory.getLogger( getClass() );
|
||||
|
||||
@Inject
|
||||
private List<AuditListener> auditListeners = new ArrayList<AuditListener>();
|
||||
|
||||
private List<AuditListener> auditListeners = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
private RepositoryCommonValidator repositoryCommonValidator;
|
||||
|
@ -75,7 +75,7 @@ public void shutdown()
|
||||
public List<LegacyArtifactPath> getLegacyArtifactPaths()
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
List<LegacyArtifactPath> legacyArtifactPaths = new ArrayList<LegacyArtifactPath>(
|
||||
List<LegacyArtifactPath> legacyArtifactPaths = new ArrayList<>(
|
||||
getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths().size() );
|
||||
for ( org.apache.archiva.configuration.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() )
|
||||
{
|
||||
@ -268,7 +268,7 @@ public List<FileType> getFileTypes()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<FileType> fileTypes = new ArrayList<FileType>( configFileTypes.size() );
|
||||
List<FileType> fileTypes = new ArrayList<>( configFileTypes.size() );
|
||||
for ( org.apache.archiva.configuration.FileType fileType : configFileTypes )
|
||||
{
|
||||
fileTypes.add( getModelMapper().map( fileType, FileType.class ) );
|
||||
@ -279,14 +279,14 @@ public List<FileType> getFileTypes()
|
||||
public List<String> getKnownContentConsumers()
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
return new ArrayList<String>(
|
||||
return new ArrayList<>(
|
||||
getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() );
|
||||
}
|
||||
|
||||
public List<String> getInvalidContentConsumers()
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
return new ArrayList<String>(
|
||||
return new ArrayList<>(
|
||||
getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() );
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ public List<RepositoryGroup> getRepositoriesGroups()
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
List<RepositoryGroup> repositoriesGroups =
|
||||
new ArrayList<RepositoryGroup>( getArchivaConfiguration().getConfiguration().getRepositoryGroups().size() );
|
||||
new ArrayList<>( getArchivaConfiguration().getConfiguration().getRepositoryGroups().size() );
|
||||
|
||||
for ( RepositoryGroupConfiguration repositoryGroupConfiguration : getArchivaConfiguration().getConfiguration().getRepositoryGroups() )
|
||||
{
|
||||
@ -289,7 +289,7 @@ public Map<String, List<String>> getGroupToRepositoryMap()
|
||||
java.util.List<String> repos = map.get( groupId );
|
||||
if ( repos == null )
|
||||
{
|
||||
repos = new ArrayList<String>();
|
||||
repos = new ArrayList<>();
|
||||
map.put( groupId, repos );
|
||||
}
|
||||
repos.add( repo.getId() );
|
||||
@ -311,7 +311,7 @@ public Map<String, List<String>> getRepositoryToGroupMap()
|
||||
java.util.List<String> groups = map.get( repositoryId );
|
||||
if ( groups == null )
|
||||
{
|
||||
groups = new ArrayList<String>();
|
||||
groups = new ArrayList<>();
|
||||
map.put( repositoryId, groups );
|
||||
}
|
||||
groups.add( group.getId() );
|
||||
|
@ -418,7 +418,7 @@ private Boolean deleteManagedRepository( ManagedRepositoryConfiguration reposito
|
||||
|
||||
// olamy: copy list for reading as a unit test in webapp fail with ConcurrentModificationException
|
||||
List<ProxyConnectorConfiguration> proxyConnectors =
|
||||
new ArrayList<ProxyConnectorConfiguration>( config.getProxyConnectors() );
|
||||
new ArrayList<>( config.getProxyConnectors() );
|
||||
for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
|
||||
{
|
||||
if ( StringUtils.equals( proxyConnector.getSourceRepoId(), repository.getId() ) )
|
||||
@ -438,7 +438,7 @@ private Boolean deleteManagedRepository( ManagedRepositoryConfiguration reposito
|
||||
// copy to prevent UnsupportedOperationException
|
||||
RepositoryGroupConfiguration repositoryGroupConfiguration =
|
||||
config.findRepositoryGroupById( repoGroup );
|
||||
List<String> repos = new ArrayList<String>( repositoryGroupConfiguration.getRepositories() );
|
||||
List<String> repos = new ArrayList<>( repositoryGroupConfiguration.getRepositories() );
|
||||
config.removeRepositoryGroup( repositoryGroupConfiguration );
|
||||
repos.remove( repository.getId() );
|
||||
repositoryGroupConfiguration.setRepositories( repos );
|
||||
|
@ -47,7 +47,7 @@ public List<NetworkProxy> getNetworkProxies()
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
List<NetworkProxy> networkProxies =
|
||||
new ArrayList<NetworkProxy>( getArchivaConfiguration().getConfiguration().getNetworkProxies().size() );
|
||||
new ArrayList<>( getArchivaConfiguration().getConfiguration().getNetworkProxies().size() );
|
||||
for ( NetworkProxyConfiguration networkProxyConfiguration : getArchivaConfiguration().getConfiguration().getNetworkProxies() )
|
||||
{
|
||||
networkProxies.add( getNetworkProxy( networkProxyConfiguration ) );
|
||||
|
@ -63,7 +63,7 @@ public List<ProxyConnector> getProxyConnectors()
|
||||
{
|
||||
List<ProxyConnectorConfiguration> proxyConnectorConfigurations =
|
||||
getArchivaConfiguration().getConfiguration().getProxyConnectors();
|
||||
List<ProxyConnector> proxyConnectors = new ArrayList<ProxyConnector>( proxyConnectorConfigurations.size() );
|
||||
List<ProxyConnector> proxyConnectors = new ArrayList<>( proxyConnectorConfigurations.size() );
|
||||
for ( ProxyConnectorConfiguration configuration : proxyConnectorConfigurations )
|
||||
{
|
||||
proxyConnectors.add( getProxyConnector( configuration ) );
|
||||
@ -152,7 +152,7 @@ protected List<String> unescapePatterns( List<String> patterns )
|
||||
{
|
||||
if ( patterns != null )
|
||||
{
|
||||
List<String> rawPatterns = new ArrayList<String>( patterns.size() );
|
||||
List<String> rawPatterns = new ArrayList<>( patterns.size() );
|
||||
for ( String pattern : patterns )
|
||||
{
|
||||
rawPatterns.add( StringUtils.replace( pattern, "\\\\", "\\" ) );
|
||||
@ -177,7 +177,7 @@ public Map<String, List<ProxyConnector>> getProxyConnectorAsMap()
|
||||
List<ProxyConnector> connectors = proxyConnectorMap.get( key );
|
||||
if ( connectors == null )
|
||||
{
|
||||
connectors = new ArrayList<ProxyConnector>( 1 );
|
||||
connectors = new ArrayList<>( 1 );
|
||||
proxyConnectorMap.put( key, connectors );
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
* @author Olivier Lamy
|
||||
* @since 1.4-M3
|
||||
*/
|
||||
@Service ("proxyConnectorRuleAdmin#default")
|
||||
@Service("proxyConnectorRuleAdmin#default")
|
||||
public class DefaultProxyConnectorRuleAdmin
|
||||
extends AbstractRepositoryAdmin
|
||||
implements ProxyConnectorRuleAdmin
|
||||
@ -57,8 +57,7 @@ public List<ProxyConnectorRule> getProxyConnectorRules()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<ProxyConnectorRule> proxyConnectorRules =
|
||||
new ArrayList<ProxyConnectorRule>( proxyConnectorRuleConfigurations.size() );
|
||||
List<ProxyConnectorRule> proxyConnectorRules = new ArrayList<>( proxyConnectorRuleConfigurations.size() );
|
||||
for ( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : proxyConnectorRuleConfigurations )
|
||||
{
|
||||
|
||||
@ -120,8 +119,7 @@ public void deleteProxyConnectorRule( ProxyConnectorRule proxyConnectorRule, Aud
|
||||
|
||||
boolean toSave = false;
|
||||
|
||||
List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations =
|
||||
new ArrayList<ProxyConnectorRuleConfiguration>();
|
||||
List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations = new ArrayList<>();
|
||||
|
||||
for ( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : configuration.getProxyConnectorRuleConfigurations() )
|
||||
{
|
||||
@ -157,7 +155,7 @@ public void updateProxyConnectorRule( ProxyConnectorRule proxyConnectorRule, Aud
|
||||
proxyConnectorRule.getProxyConnectorRuleType().getRuleType() ) )
|
||||
{
|
||||
List<ProxyConnectorConfiguration> proxyConnectors =
|
||||
new ArrayList<ProxyConnectorConfiguration>( proxyConnectorRule.getProxyConnectors().size() );
|
||||
new ArrayList<>( proxyConnectorRule.getProxyConnectors().size() );
|
||||
for ( ProxyConnector proxyConnector : proxyConnectorRule.getProxyConnectors() )
|
||||
{
|
||||
ProxyConnectorConfiguration proxyConnectorConfiguration = new ProxyConnectorConfiguration();
|
||||
|
@ -52,7 +52,7 @@
|
||||
* @author Olivier Lamy
|
||||
* @since 1.4-M1
|
||||
*/
|
||||
@Service ( "remoteRepositoryAdmin#default" )
|
||||
@Service("remoteRepositoryAdmin#default")
|
||||
public class DefaultRemoteRepositoryAdmin
|
||||
extends AbstractRepositoryAdmin
|
||||
implements RemoteRepositoryAdmin
|
||||
@ -115,8 +115,8 @@ private void shutdown()
|
||||
public List<RemoteRepository> getRemoteRepositories()
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
List<RemoteRepository> remoteRepositories = new ArrayList<RemoteRepository>(
|
||||
getArchivaConfiguration().getConfiguration().getRemoteRepositories().size() );
|
||||
List<RemoteRepository> remoteRepositories =
|
||||
new ArrayList<>( getArchivaConfiguration().getConfiguration().getRemoteRepositories().size() );
|
||||
for ( RemoteRepositoryConfiguration repositoryConfiguration : getArchivaConfiguration().getConfiguration().getRemoteRepositories() )
|
||||
{
|
||||
RemoteRepository remoteRepository =
|
||||
@ -199,8 +199,7 @@ public Boolean deleteRemoteRepository( String repositoryId, AuditInformation aud
|
||||
|
||||
// TODO use ProxyConnectorAdmin interface ?
|
||||
// [MRM-520] Proxy Connectors are not deleted with the deletion of a Repository.
|
||||
List<ProxyConnectorConfiguration> proxyConnectors =
|
||||
new ArrayList<ProxyConnectorConfiguration>( configuration.getProxyConnectors() );
|
||||
List<ProxyConnectorConfiguration> proxyConnectors = new ArrayList<>( configuration.getProxyConnectors() );
|
||||
for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
|
||||
{
|
||||
if ( StringUtils.equals( proxyConnector.getTargetRepoId(), repositoryId ) )
|
||||
|
@ -52,7 +52,7 @@
|
||||
* @author Olivier Lamy
|
||||
* @since 1.4-M4
|
||||
*/
|
||||
@Service( "redbackRuntimeConfigurationAdmin#default" )
|
||||
@Service("redbackRuntimeConfigurationAdmin#default")
|
||||
public class DefaultRedbackRuntimeConfigurationAdmin
|
||||
extends AbstractRepositoryAdmin
|
||||
implements RedbackRuntimeConfigurationAdmin, UserConfiguration
|
||||
@ -68,9 +68,9 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||
|
||||
@Inject
|
||||
public DefaultRedbackRuntimeConfigurationAdmin( ArchivaConfiguration archivaConfiguration,//
|
||||
@Named( value = "userConfiguration#redback" ) //
|
||||
@Named(value = "userConfiguration#redback") //
|
||||
UserConfiguration userConfiguration,
|
||||
@Named( value = "cache#users" ) Cache usersCache )
|
||||
@Named(value = "cache#users") Cache usersCache )
|
||||
{
|
||||
this.archivaConfiguration = archivaConfiguration;
|
||||
this.userConfiguration = userConfiguration;
|
||||
@ -164,7 +164,7 @@ public void initialize()
|
||||
|
||||
Collection<String> keys = userConfiguration.getKeys();
|
||||
|
||||
List<LdapGroupMapping> ldapGroupMappings = new ArrayList<LdapGroupMapping>();
|
||||
List<LdapGroupMapping> ldapGroupMappings = new ArrayList<>();
|
||||
|
||||
for ( String key : keys )
|
||||
{
|
||||
@ -344,7 +344,7 @@ private RedbackRuntimeConfiguration build(
|
||||
|
||||
if ( mappings != null && mappings.size() > 0 )
|
||||
{
|
||||
List<LdapGroupMapping> ldapGroupMappings = new ArrayList<LdapGroupMapping>( mappings.size() );
|
||||
List<LdapGroupMapping> ldapGroupMappings = new ArrayList<>( mappings.size() );
|
||||
|
||||
for ( org.apache.archiva.configuration.LdapGroupMapping mapping : mappings )
|
||||
{
|
||||
@ -417,7 +417,7 @@ private org.apache.archiva.configuration.RedbackRuntimeConfiguration build(
|
||||
{
|
||||
|
||||
List<org.apache.archiva.configuration.LdapGroupMapping> mappings =
|
||||
new ArrayList<org.apache.archiva.configuration.LdapGroupMapping>( ldapGroupMappings.size() );
|
||||
new ArrayList<>( ldapGroupMappings.size() );
|
||||
|
||||
for ( LdapGroupMapping ldapGroupMapping : ldapGroupMappings )
|
||||
{
|
||||
@ -425,7 +425,7 @@ private org.apache.archiva.configuration.RedbackRuntimeConfiguration build(
|
||||
org.apache.archiva.configuration.LdapGroupMapping mapping =
|
||||
new org.apache.archiva.configuration.LdapGroupMapping();
|
||||
mapping.setGroup( ldapGroupMapping.getGroup() );
|
||||
mapping.setRoleNames( new ArrayList<String>( ldapGroupMapping.getRoleNames() ) );
|
||||
mapping.setRoleNames( new ArrayList<>( ldapGroupMapping.getRoleNames() ) );
|
||||
mappings.add( mapping );
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class MockAuditListener
|
||||
implements AuditListener
|
||||
{
|
||||
|
||||
private List<AuditEvent> auditEvents = new ArrayList<AuditEvent>();
|
||||
private List<AuditEvent> auditEvents = new ArrayList<>();
|
||||
|
||||
public void auditEvent( AuditEvent event )
|
||||
{
|
||||
|
@ -349,8 +349,8 @@ public String getRepositorySpecificName( String proxyId, String path )
|
||||
@PostConstruct
|
||||
public void initialize()
|
||||
{
|
||||
this.artifactPatterns = new ArrayList<String>();
|
||||
this.proxies = new HashMap<String, Set<String>>();
|
||||
this.artifactPatterns = new ArrayList<>();
|
||||
this.proxies = new HashMap<>();
|
||||
initConfigVariables();
|
||||
|
||||
configuration.addChangeListener( this );
|
||||
@ -504,7 +504,7 @@ private Set<String> findPossibleVersions( Set<String> versions, File metadataPar
|
||||
private List<ArchivaRepositoryMetadata> getMetadatasForManagedRepository(
|
||||
ManagedRepositoryContent managedRepository, String logicalResource )
|
||||
{
|
||||
List<ArchivaRepositoryMetadata> metadatas = new ArrayList<ArchivaRepositoryMetadata>();
|
||||
List<ArchivaRepositoryMetadata> metadatas = new ArrayList<>();
|
||||
File file = new File( managedRepository.getRepoRoot(), logicalResource );
|
||||
if ( file.exists() )
|
||||
{
|
||||
@ -622,7 +622,7 @@ public void updateMetadata( ManagedRepositoryContent managedRepository, ProjectR
|
||||
else
|
||||
{
|
||||
// Add the plugins to the metadata model.
|
||||
metadata.setPlugins( new ArrayList<Plugin>( allPlugins ) );
|
||||
metadata.setPlugins( new ArrayList<>( allPlugins ) );
|
||||
|
||||
// artifact ID was actually the last part of the group
|
||||
metadata.setGroupId( metadata.getGroupId() + "." + metadata.getArtifactId() );
|
||||
@ -643,12 +643,12 @@ public void updateMetadata( ManagedRepositoryContent managedRepository, ProjectR
|
||||
private void updateMetadataVersions( Collection<String> allVersions, ArchivaRepositoryMetadata metadata )
|
||||
{
|
||||
// Sort the versions
|
||||
List<String> sortedVersions = new ArrayList<String>( allVersions );
|
||||
List<String> sortedVersions = new ArrayList<>( allVersions );
|
||||
Collections.sort( sortedVersions, VersionComparator.getInstance() );
|
||||
|
||||
// Split the versions into released and snapshots.
|
||||
List<String> releasedVersions = new ArrayList<String>();
|
||||
List<String> snapshotVersions = new ArrayList<String>();
|
||||
List<String> releasedVersions = new ArrayList<>();
|
||||
List<String> snapshotVersions = new ArrayList<>();
|
||||
|
||||
for ( String version : sortedVersions )
|
||||
{
|
||||
@ -795,7 +795,7 @@ public void updateMetadata( ManagedRepositoryContent managedRepository, Versione
|
||||
}
|
||||
|
||||
// sort the list to determine to aide in determining the Latest version.
|
||||
List<String> sortedVersions = new ArrayList<String>();
|
||||
List<String> sortedVersions = new ArrayList<>();
|
||||
sortedVersions.addAll( snapshotVersions );
|
||||
Collections.sort( sortedVersions, new VersionComparator() );
|
||||
|
||||
|
@ -210,7 +210,7 @@ private static List<Plugin> clonePlugins(List<Plugin> plugins)
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Plugin> result = new ArrayList<Plugin>();
|
||||
List<Plugin> result = new ArrayList<>();
|
||||
|
||||
for (Plugin plugin : plugins)
|
||||
{
|
||||
|
@ -99,8 +99,8 @@ public RepositoryScanStatistics scan( ManagedRepository repository,
|
||||
|
||||
// Setup Includes / Excludes.
|
||||
|
||||
List<String> allExcludes = new ArrayList<String>();
|
||||
List<String> allIncludes = new ArrayList<String>();
|
||||
List<String> allExcludes = new ArrayList<>();
|
||||
List<String> allIncludes = new ArrayList<>();
|
||||
|
||||
if ( CollectionUtils.isNotEmpty( ignoredContentPatterns ) )
|
||||
{
|
||||
@ -147,7 +147,7 @@ public RepositoryScanStatistics scan( ManagedRepository repository,
|
||||
|
||||
private List<String> gatherIds( List<? extends RepositoryContentConsumer> consumers )
|
||||
{
|
||||
List<String> ids = new ArrayList<String>();
|
||||
List<String> ids = new ArrayList<>();
|
||||
for ( RepositoryContentConsumer consumer : consumers )
|
||||
{
|
||||
ids.add( consumer.getId() );
|
||||
|
@ -164,7 +164,7 @@ public synchronized List<KnownRepositoryContentConsumer> getSelectedKnownConsume
|
||||
{
|
||||
return selectedKnownConsumers;
|
||||
}
|
||||
List<KnownRepositoryContentConsumer> ret = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> ret = new ArrayList<>();
|
||||
|
||||
List<String> knownSelected = getSelectedKnownConsumerIds();
|
||||
|
||||
@ -195,7 +195,7 @@ public synchronized List<InvalidRepositoryContentConsumer> getSelectedInvalidCon
|
||||
return selectedInvalidConsumers;
|
||||
}
|
||||
|
||||
List<InvalidRepositoryContentConsumer> ret = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> ret = new ArrayList<>();
|
||||
|
||||
List<String> invalidSelected = getSelectedInvalidConsumerIds();
|
||||
|
||||
@ -219,7 +219,7 @@ public synchronized List<InvalidRepositoryContentConsumer> getSelectedInvalidCon
|
||||
*/
|
||||
public List<KnownRepositoryContentConsumer> getAvailableKnownConsumers()
|
||||
{
|
||||
return new ArrayList<KnownRepositoryContentConsumer>(
|
||||
return new ArrayList<>(
|
||||
applicationContext.getBeansOfType( KnownRepositoryContentConsumer.class ).values() );
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ public List<KnownRepositoryContentConsumer> getAvailableKnownConsumers()
|
||||
*/
|
||||
public List<InvalidRepositoryContentConsumer> getAvailableInvalidConsumers()
|
||||
{
|
||||
return new ArrayList<InvalidRepositoryContentConsumer>(
|
||||
return new ArrayList<>(
|
||||
applicationContext.getBeansOfType( InvalidRepositoryContentConsumer.class ).values() );
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ public void executeConsumers( ManagedRepository repository, File localFile, bool
|
||||
// - do not create missing/fix invalid checksums and update metadata when deploying from webdav since these are uploaded by maven
|
||||
if ( !updateRelatedArtifacts )
|
||||
{
|
||||
List<KnownRepositoryContentConsumer> clone = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> clone = new ArrayList<>();
|
||||
clone.addAll( selectedKnownConsumers );
|
||||
|
||||
for ( KnownRepositoryContentConsumer consumer : clone )
|
||||
|
@ -42,7 +42,7 @@ public class KnownScanConsumer
|
||||
{
|
||||
private int processCount = 0;
|
||||
|
||||
private List<String> includes = new ArrayList<String>();
|
||||
private List<String> includes = new ArrayList<>();
|
||||
|
||||
private boolean processUnmodified = false;
|
||||
|
||||
|
@ -143,7 +143,7 @@ private RepositoryScanner lookupRepositoryScanner()
|
||||
|
||||
private List<String> getIgnoreList()
|
||||
{
|
||||
List<String> ignores = new ArrayList<String>();
|
||||
List<String> ignores = new ArrayList<>();
|
||||
ignores.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) );
|
||||
return ignores;
|
||||
}
|
||||
@ -154,12 +154,12 @@ public void testTimestampRepositoryScanner()
|
||||
{
|
||||
ManagedRepository repository = createSimpleRepository();
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>();
|
||||
KnownScanConsumer consumer = new KnownScanConsumer();
|
||||
consumer.setIncludes( ARTIFACT_PATTERNS );
|
||||
knownConsumers.add( consumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
InvalidScanConsumer badconsumer = new InvalidScanConsumer();
|
||||
invalidConsumers.add( badconsumer );
|
||||
|
||||
@ -181,12 +181,12 @@ public void testTimestampRepositoryScannerFreshScan()
|
||||
{
|
||||
ManagedRepository repository = createSimpleRepository();
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>();
|
||||
KnownScanConsumer consumer = new KnownScanConsumer();
|
||||
consumer.setIncludes( ARTIFACT_PATTERNS );
|
||||
knownConsumers.add( consumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
InvalidScanConsumer badconsumer = new InvalidScanConsumer();
|
||||
invalidConsumers.add( badconsumer );
|
||||
|
||||
@ -207,13 +207,13 @@ public void testTimestampRepositoryScannerProcessUnmodified()
|
||||
{
|
||||
ManagedRepository repository = createSimpleRepository();
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>();
|
||||
KnownScanConsumer consumer = new KnownScanConsumer();
|
||||
consumer.setProcessUnmodified( true );
|
||||
consumer.setIncludes( ARTIFACT_PATTERNS );
|
||||
knownConsumers.add( consumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
InvalidScanConsumer badconsumer = new InvalidScanConsumer();
|
||||
invalidConsumers.add( badconsumer );
|
||||
|
||||
@ -234,14 +234,14 @@ public void testDefaultRepositoryScanner()
|
||||
{
|
||||
ManagedRepository repository = createDefaultRepository();
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>();
|
||||
KnownScanConsumer consumer = new KnownScanConsumer();
|
||||
consumer.setIncludes(
|
||||
new String[]{ "**/*.jar", "**/*.war", "**/*.pom", "**/maven-metadata.xml", "**/*-site.xml", "**/*.zip",
|
||||
"**/*.tar.gz", "**/*.sha1", "**/*.md5" } );
|
||||
knownConsumers.add( consumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
InvalidScanConsumer badconsumer = new InvalidScanConsumer();
|
||||
invalidConsumers.add( badconsumer );
|
||||
|
||||
@ -259,7 +259,7 @@ public void testDefaultRepositoryScanner()
|
||||
public void testDefaultRepositoryArtifactScanner()
|
||||
throws Exception
|
||||
{
|
||||
List<String> actualArtifactPaths = new ArrayList<String>();
|
||||
List<String> actualArtifactPaths = new ArrayList<>();
|
||||
|
||||
actualArtifactPaths.add( "invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar" );
|
||||
actualArtifactPaths.add( "invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar" );
|
||||
@ -295,12 +295,12 @@ public void testDefaultRepositoryArtifactScanner()
|
||||
|
||||
ManagedRepository repository = createDefaultRepository();
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>();
|
||||
KnownScanConsumer consumer = new KnownScanConsumer();
|
||||
consumer.setIncludes( ARTIFACT_PATTERNS );
|
||||
knownConsumers.add( consumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
InvalidScanConsumer badconsumer = new InvalidScanConsumer();
|
||||
invalidConsumers.add( badconsumer );
|
||||
|
||||
@ -317,7 +317,7 @@ public void testDefaultRepositoryArtifactScanner()
|
||||
public void testDefaultRepositoryMetadataScanner()
|
||||
throws Exception
|
||||
{
|
||||
List<String> actualMetadataPaths = new ArrayList<String>();
|
||||
List<String> actualMetadataPaths = new ArrayList<>();
|
||||
|
||||
actualMetadataPaths.add( "org/apache/maven/some-ejb/1.0/maven-metadata.xml" );
|
||||
actualMetadataPaths.add( "org/apache/maven/update/test-not-updated/maven-metadata.xml" );
|
||||
@ -332,12 +332,12 @@ public void testDefaultRepositoryMetadataScanner()
|
||||
|
||||
ManagedRepository repository = createDefaultRepository();
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>();
|
||||
KnownScanConsumer knownConsumer = new KnownScanConsumer();
|
||||
knownConsumer.setIncludes( new String[]{ "**/maven-metadata*.xml" } );
|
||||
knownConsumers.add( knownConsumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
InvalidScanConsumer badconsumer = new InvalidScanConsumer();
|
||||
invalidConsumers.add( badconsumer );
|
||||
|
||||
@ -354,7 +354,7 @@ public void testDefaultRepositoryMetadataScanner()
|
||||
public void testDefaultRepositoryProjectScanner()
|
||||
throws Exception
|
||||
{
|
||||
List<String> actualProjectPaths = new ArrayList<String>();
|
||||
List<String> actualProjectPaths = new ArrayList<>();
|
||||
|
||||
actualProjectPaths.add( "org/apache/maven/A/1.0/A-1.0.pom" );
|
||||
actualProjectPaths.add( "org/apache/maven/B/2.0/B-2.0.pom" );
|
||||
@ -369,12 +369,12 @@ public void testDefaultRepositoryProjectScanner()
|
||||
|
||||
ManagedRepository repository = createDefaultRepository();
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>();
|
||||
KnownScanConsumer consumer = new KnownScanConsumer();
|
||||
consumer.setIncludes( new String[]{ "**/*.pom" } );
|
||||
knownConsumers.add( consumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
InvalidScanConsumer badconsumer = new InvalidScanConsumer();
|
||||
invalidConsumers.add( badconsumer );
|
||||
|
||||
@ -391,7 +391,7 @@ public void testDefaultRepositoryProjectScanner()
|
||||
public void testLegacyRepositoryArtifactScanner()
|
||||
throws Exception
|
||||
{
|
||||
List<String> actualArtifactPaths = new ArrayList<String>();
|
||||
List<String> actualArtifactPaths = new ArrayList<>();
|
||||
|
||||
actualArtifactPaths.add( "invalid/jars/1.0/invalid-1.0.jar" );
|
||||
actualArtifactPaths.add( "invalid/jars/invalid-1.0.rar" );
|
||||
@ -410,12 +410,12 @@ public void testLegacyRepositoryArtifactScanner()
|
||||
|
||||
ManagedRepository repository = createLegacyRepository();
|
||||
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
|
||||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>();
|
||||
KnownScanConsumer consumer = new KnownScanConsumer();
|
||||
consumer.setIncludes( ARTIFACT_PATTERNS );
|
||||
knownConsumers.add( consumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
InvalidScanConsumer badconsumer = new InvalidScanConsumer();
|
||||
invalidConsumers.add( badconsumer );
|
||||
|
||||
|
@ -58,7 +58,7 @@ static List<FrameworkMethod> getShuffleList( List<FrameworkMethod> computeTestMe
|
||||
return null;
|
||||
}
|
||||
|
||||
List<FrameworkMethod> generated = new ArrayList<FrameworkMethod>();
|
||||
List<FrameworkMethod> generated = new ArrayList<>();
|
||||
|
||||
testRound = Math.min( MAXROUND, testRound );
|
||||
|
||||
|
@ -40,11 +40,11 @@
|
||||
public abstract class AbstractTransactionEvent
|
||||
implements TransactionEvent
|
||||
{
|
||||
private Map<File, File> backups = new HashMap<File, File>();
|
||||
private Map<File, File> backups = new HashMap<>();
|
||||
|
||||
private List<File> createdDirs = new ArrayList<File>();
|
||||
private List<File> createdDirs = new ArrayList<>();
|
||||
|
||||
private List<File> createdFiles = new ArrayList<File>();
|
||||
private List<File> createdFiles = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* {@link List}<{@link Digester}>
|
||||
@ -75,7 +75,7 @@ protected List<? extends Digester> getDigesters()
|
||||
protected void mkDirs( File dir )
|
||||
throws IOException
|
||||
{
|
||||
List<File> createDirs = new ArrayList<File>();
|
||||
List<File> createDirs = new ArrayList<>();
|
||||
|
||||
File parent = dir;
|
||||
while ( !parent.exists() || !parent.isDirectory() )
|
||||
@ -87,7 +87,7 @@ protected void mkDirs( File dir )
|
||||
|
||||
while ( !createDirs.isEmpty() )
|
||||
{
|
||||
File directory = (File) createDirs.remove( createDirs.size() - 1 );
|
||||
File directory = createDirs.remove( createDirs.size() - 1 );
|
||||
|
||||
if ( directory.mkdir() )
|
||||
{
|
||||
|
@ -32,7 +32,7 @@
|
||||
*/
|
||||
public class FileTransaction
|
||||
{
|
||||
private List<AbstractTransactionEvent> events = new ArrayList<AbstractTransactionEvent>();
|
||||
private List<AbstractTransactionEvent> events = new ArrayList<>();
|
||||
|
||||
public void commit()
|
||||
throws TransactionException
|
||||
|
@ -100,9 +100,9 @@ public class DefaultRepositoryArchivaTaskScheduler
|
||||
|
||||
public static final String CRON_HOURLY = "0 0 * * * ?";
|
||||
|
||||
private Set<String> jobs = new HashSet<String>();
|
||||
private Set<String> jobs = new HashSet<>();
|
||||
|
||||
private List<String> queuedRepos = new ArrayList<String>();
|
||||
private List<String> queuedRepos = new ArrayList<>();
|
||||
|
||||
@PostConstruct
|
||||
public void startup()
|
||||
|
@ -108,7 +108,7 @@ public void setKnownContentConsumers( List<String> knownContentConsumers, AuditI
|
||||
public List<String> getKnownContentConsumers()
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
return new ArrayList<String>(
|
||||
return new ArrayList<>(
|
||||
getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() );
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ public void setInvalidContentConsumers( List<String> invalidContentConsumers, Au
|
||||
public List<String> getInvalidContentConsumers()
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
return new ArrayList<String>(
|
||||
return new ArrayList<>(
|
||||
getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() );
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public List<ManagedRepository> getManagedRepositories()
|
||||
List<ManagedRepositoryConfiguration> managedRepoConfigs =
|
||||
getArchivaConfiguration().getConfiguration().getManagedRepositories();
|
||||
|
||||
List<ManagedRepository> managedRepos = new ArrayList<ManagedRepository>( managedRepoConfigs.size() );
|
||||
List<ManagedRepository> managedRepos = new ArrayList<>( managedRepoConfigs.size() );
|
||||
|
||||
for ( ManagedRepositoryConfiguration repoConfig : managedRepoConfigs )
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ private List<RepositoryStatistics> getStatsList( String repositoryId )
|
||||
List<RepositoryStatistics> stats = repoStats.get( repositoryId );
|
||||
if ( stats == null )
|
||||
{
|
||||
stats = new ArrayList<RepositoryStatistics>();
|
||||
stats = new ArrayList<>();
|
||||
repoStats.put( repositoryId, stats );
|
||||
}
|
||||
return stats;
|
||||
|
@ -62,7 +62,7 @@ public class SearchRequest
|
||||
/**
|
||||
* repositories
|
||||
*/
|
||||
private List<String> repositories = new ArrayList<String>();
|
||||
private List<String> repositories = new ArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
|
@ -77,7 +77,7 @@ public abstract class AbstractRestService
|
||||
protected Logger log = LoggerFactory.getLogger( getClass() );
|
||||
|
||||
@Inject
|
||||
private List<AuditListener> auditListeners = new ArrayList<AuditListener>();
|
||||
private List<AuditListener> auditListeners = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
protected UserRepositories userRepositories;
|
||||
@ -272,7 +272,7 @@ protected List<Artifact> buildArtifacts( List<ArtifactMetadata> artifactMetadata
|
||||
{
|
||||
if ( artifactMetadatas != null && !artifactMetadatas.isEmpty() )
|
||||
{
|
||||
List<Artifact> artifacts = new ArrayList<Artifact>( artifactMetadatas.size() );
|
||||
List<Artifact> artifacts = new ArrayList<>( artifactMetadatas.size() );
|
||||
for ( ArtifactMetadata artifact : artifactMetadatas )
|
||||
{
|
||||
|
||||
|
@ -144,7 +144,7 @@ public BrowseResult getRootGroups( String repositoryId )
|
||||
repositorySession.close();
|
||||
}
|
||||
|
||||
List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<BrowseResultEntry>( namespaces.size() );
|
||||
List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<>( namespaces.size() );
|
||||
for ( String namespace : namespaces )
|
||||
{
|
||||
browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ) );
|
||||
@ -196,7 +196,7 @@ public BrowseResult browseGroupId( String groupId, String repositoryId )
|
||||
repositorySession.close();
|
||||
}
|
||||
List<BrowseResultEntry> browseGroupResultEntries =
|
||||
new ArrayList<BrowseResultEntry>( namespaces.size() + projects.size() );
|
||||
new ArrayList<>( namespaces.size() + projects.size() );
|
||||
for ( String namespace : namespaces )
|
||||
{
|
||||
browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ).groupId( namespace ) );
|
||||
@ -219,7 +219,7 @@ public VersionsList getVersionsList( String groupId, String artifactId, String r
|
||||
try
|
||||
{
|
||||
Collection<String> versions = getVersions( selectedRepos, groupId, artifactId );
|
||||
return new VersionsList( new ArrayList<String>( versions ) );
|
||||
return new VersionsList( new ArrayList<>( versions ) );
|
||||
}
|
||||
catch ( MetadataResolutionException e )
|
||||
{
|
||||
@ -247,7 +247,7 @@ private Collection<String> getVersions( List<String> selectedRepos, String group
|
||||
versions.addAll( projectVersions );
|
||||
}
|
||||
|
||||
List<String> sortedVersions = new ArrayList<String>( versions );
|
||||
List<String> sortedVersions = new ArrayList<>( versions );
|
||||
|
||||
Collections.sort( sortedVersions, VersionComparator.getInstance() );
|
||||
|
||||
@ -499,7 +499,7 @@ public List<ManagedRepository> getUserRepositories()
|
||||
public List<Artifact> getDependees( String groupId, String artifactId, String version, String repositoryId )
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
List<ProjectVersionReference> references = new ArrayList<ProjectVersionReference>();
|
||||
List<ProjectVersionReference> references = new ArrayList<>();
|
||||
// TODO: what if we get duplicates across repositories?
|
||||
RepositorySession repositorySession = repositorySessionFactory.createSession();
|
||||
try
|
||||
@ -523,7 +523,7 @@ public List<Artifact> getDependees( String groupId, String artifactId, String ve
|
||||
repositorySession.close();
|
||||
}
|
||||
|
||||
List<Artifact> artifacts = new ArrayList<Artifact>( references.size() );
|
||||
List<Artifact> artifacts = new ArrayList<>( references.size() );
|
||||
|
||||
for ( ProjectVersionReference projectVersionReference : references )
|
||||
{
|
||||
@ -549,7 +549,7 @@ public List<Entry> getMetadatas( String groupId, String artifactId, String versi
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Map<String, String> map = metadataFacet.toProperties();
|
||||
List<Entry> entries = new ArrayList<Entry>( map.size() );
|
||||
List<Entry> entries = new ArrayList<>( map.size() );
|
||||
|
||||
for ( Map.Entry<String, String> entry : map.entrySet() )
|
||||
{
|
||||
@ -711,7 +711,7 @@ public List<Artifact> getArtifactDownloadInfos( String groupId, String artifactI
|
||||
{
|
||||
List<String> selectedRepos = getSelectedRepos( repositoryId );
|
||||
|
||||
List<Artifact> artifactDownloadInfos = new ArrayList<Artifact>();
|
||||
List<Artifact> artifactDownloadInfos = new ArrayList<>();
|
||||
|
||||
RepositorySession session = repositorySessionFactory.createSession();
|
||||
|
||||
@ -721,7 +721,7 @@ public List<Artifact> getArtifactDownloadInfos( String groupId, String artifactI
|
||||
{
|
||||
for ( String repoId : selectedRepos )
|
||||
{
|
||||
List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>(
|
||||
List<ArtifactMetadata> artifacts = new ArrayList<>(
|
||||
metadataResolver.resolveArtifacts( session, repoId, groupId, artifactId, version ) );
|
||||
Collections.sort( artifacts, ArtifactMetadataVersionComparator.INSTANCE );
|
||||
if ( artifacts != null && !artifacts.isEmpty() )
|
||||
@ -1037,7 +1037,7 @@ protected List<ArtifactContentEntry> readFileEntries( File file, String filterPa
|
||||
jarFile.close();
|
||||
}
|
||||
}
|
||||
List<ArtifactContentEntry> sorted = new ArrayList<ArtifactContentEntry>( artifactContentEntryMap.values() );
|
||||
List<ArtifactContentEntry> sorted = new ArrayList<>( artifactContentEntryMap.values() );
|
||||
Collections.sort( sorted, ArtifactContentEntryComparator.INSTANCE );
|
||||
return sorted;
|
||||
}
|
||||
@ -1060,7 +1060,7 @@ private List<ArtifactContentEntry> getSmallerDepthEntries( Map<String, ArtifactC
|
||||
|
||||
if ( currentList == null )
|
||||
{
|
||||
currentList = new ArrayList<ArtifactContentEntry>();
|
||||
currentList = new ArrayList<>();
|
||||
currentList.add( current );
|
||||
perDepthList.put( current.getDepth(), currentList );
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ private void mergeWithOutSnapshots( MetadataRepository metadataRepository, List<
|
||||
String sourceRepoId, String repoid )
|
||||
throws RepositoryMergerException
|
||||
{
|
||||
List<ArtifactMetadata> artifactsWithOutSnapshots = new ArrayList<ArtifactMetadata>();
|
||||
List<ArtifactMetadata> artifactsWithOutSnapshots = new ArrayList<>();
|
||||
for ( ArtifactMetadata metadata : sourceArtifacts )
|
||||
{
|
||||
if ( VersionUtil.isSnapshot( metadata.getProjectVersion() ) )
|
||||
|
@ -42,9 +42,9 @@ public class DefaultPluginsServices
|
||||
implements PluginsService
|
||||
{
|
||||
|
||||
private List<String> repositoryType = new ArrayList<String>();
|
||||
private List<String> repositoryType = new ArrayList<>();
|
||||
|
||||
private List<String> adminFeatures = new ArrayList<String>();
|
||||
private List<String> adminFeatures = new ArrayList<>();
|
||||
|
||||
private ApplicationContext appCont;
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class DefaultProxyConnectorService
|
||||
@Inject
|
||||
public DefaultProxyConnectorService( ApplicationContext applicationContext )
|
||||
{
|
||||
allPolicies = new ArrayList<Policy>( getBeansOfType( applicationContext, Policy.class ).values() );
|
||||
allPolicies = new ArrayList<>( getBeansOfType( applicationContext, Policy.class ).values() );
|
||||
}
|
||||
|
||||
public List<ProxyConnector> getProxyConnectors()
|
||||
@ -146,7 +146,7 @@ public Boolean updateProxyConnector( ProxyConnector proxyConnector )
|
||||
public List<PolicyInformation> getAllPolicyInformations()
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
List<PolicyInformation> policyInformations = new ArrayList<PolicyInformation>( allPolicies.size() );
|
||||
List<PolicyInformation> policyInformations = new ArrayList<>( allPolicies.size() );
|
||||
|
||||
for ( Policy policy : allPolicies )
|
||||
{
|
||||
|
@ -200,8 +200,7 @@ public List<UserManagerImplementationInformation> getUserManagerImplementationIn
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<UserManagerImplementationInformation> informations =
|
||||
new ArrayList<UserManagerImplementationInformation>( beans.size() );
|
||||
List<UserManagerImplementationInformation> informations = new ArrayList<>( beans.size() );
|
||||
|
||||
for ( Map.Entry<String, UserManager> entry : beans.entrySet() )
|
||||
{
|
||||
@ -229,8 +228,7 @@ public List<RBACManagerImplementationInformation> getRbacManagerImplementationIn
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<RBACManagerImplementationInformation> informations =
|
||||
new ArrayList<RBACManagerImplementationInformation>( beans.size() );
|
||||
List<RBACManagerImplementationInformation> informations = new ArrayList<>( beans.size() );
|
||||
|
||||
for ( Map.Entry<String, RBACManager> entry : beans.entrySet() )
|
||||
{
|
||||
@ -314,12 +312,12 @@ public Boolean checkLdapConnection( LdapConfiguration ldapConfiguration )
|
||||
}
|
||||
catch ( InvalidNameException e )
|
||||
{
|
||||
log.warn( "fail to get ldapConnection: {}", e.getMessage(), e);
|
||||
log.warn( "fail to get ldapConnection: {}", e.getMessage(), e );
|
||||
throw new ArchivaRestServiceException( e.getMessage(), e );
|
||||
}
|
||||
catch ( LdapException e )
|
||||
{
|
||||
log.warn( "fail to get ldapConnection: {}", e.getMessage(), e);
|
||||
log.warn( "fail to get ldapConnection: {}", e.getMessage(), e );
|
||||
throw new ArchivaRestServiceException( e.getMessage(), e );
|
||||
}
|
||||
finally
|
||||
|
@ -73,7 +73,7 @@ private List<RepositoryStatistics> getMultipleRepositoriesReport( List<String> r
|
||||
try
|
||||
{
|
||||
MetadataRepository metadataRepository = repositorySession.getRepository();
|
||||
List<RepositoryStatistics> stats = new ArrayList<RepositoryStatistics>();
|
||||
List<RepositoryStatistics> stats = new ArrayList<>();
|
||||
for ( String repo : repositoriesId )
|
||||
{
|
||||
try
|
||||
@ -140,10 +140,10 @@ public List<RepositoryProblemFacet> getHealthReport( String repository, String g
|
||||
|
||||
if ( !ALL_REPOSITORIES.equals( repository ) )
|
||||
{
|
||||
observableRepositories = Collections.<String>singletonList( repository );
|
||||
observableRepositories = Collections.singletonList( repository );
|
||||
}
|
||||
|
||||
List<RepositoryProblemFacet> problemArtifacts = new ArrayList<RepositoryProblemFacet>();
|
||||
List<RepositoryProblemFacet> problemArtifacts = new ArrayList<>();
|
||||
MetadataRepository metadataRepository = repositorySession.getRepository();
|
||||
for ( String repoId : observableRepositories )
|
||||
{
|
||||
|
@ -554,7 +554,7 @@ private void updateProjectMetadata( String targetPath, Date lastUpdatedTimestamp
|
||||
boolean fixChecksums, ArtifactTransferRequest artifactTransferRequest )
|
||||
throws RepositoryMetadataException
|
||||
{
|
||||
List<String> availableVersions = new ArrayList<String>();
|
||||
List<String> availableVersions = new ArrayList<>();
|
||||
String latestVersion = artifactTransferRequest.getVersion();
|
||||
|
||||
File projectDir = new File( targetPath ).getParentFile();
|
||||
@ -1123,7 +1123,7 @@ private void updateMetadata( ArchivaRepositoryMetadata metadata, File metadataFi
|
||||
Artifact artifact )
|
||||
throws RepositoryMetadataException
|
||||
{
|
||||
List<String> availableVersions = new ArrayList<String>();
|
||||
List<String> availableVersions = new ArrayList<>();
|
||||
String latestVersion = "";
|
||||
|
||||
if ( metadataFile.exists() )
|
||||
|
@ -48,10 +48,10 @@ public List<RepositoryGroup> getRepositoriesGroups()
|
||||
try
|
||||
{
|
||||
List<RepositoryGroup> repositoriesGroups =
|
||||
new ArrayList<RepositoryGroup>( repositoryGroupAdmin.getRepositoriesGroups().size() );
|
||||
new ArrayList<>( repositoryGroupAdmin.getRepositoriesGroups().size() );
|
||||
for ( org.apache.archiva.admin.model.beans.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() )
|
||||
{
|
||||
repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
|
||||
repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList<>(
|
||||
repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl(
|
||||
repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ) );
|
||||
}
|
||||
@ -82,7 +82,7 @@ public Boolean addRepositoryGroup( RepositoryGroup repoGroup )
|
||||
try
|
||||
{
|
||||
return repositoryGroupAdmin.addRepositoryGroup(
|
||||
new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
|
||||
new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<>(
|
||||
repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl(
|
||||
repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ),
|
||||
getAuditInformation() );
|
||||
@ -99,7 +99,7 @@ public Boolean updateRepositoryGroup( RepositoryGroup repoGroup )
|
||||
try
|
||||
{
|
||||
return repositoryGroupAdmin.updateRepositoryGroup(
|
||||
new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
|
||||
new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<>(
|
||||
repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl(
|
||||
repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ),
|
||||
getAuditInformation() );
|
||||
|
@ -170,7 +170,7 @@ public GroupIdList getAllGroupIds( List<String> selectedRepos )
|
||||
}
|
||||
try
|
||||
{
|
||||
return new GroupIdList( new ArrayList<String>( repositorySearch.getAllGroupIds( getPrincipal(), repos ) ) );
|
||||
return new GroupIdList( new ArrayList<>( repositorySearch.getAllGroupIds( getPrincipal(), repos ) ) );
|
||||
}
|
||||
catch ( RepositorySearchException e )
|
||||
{
|
||||
@ -209,7 +209,7 @@ protected List<Artifact> getArtifacts( SearchResults searchResults )
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Artifact> artifacts = new ArrayList<Artifact>( searchResults.getReturnedHitsCount() );
|
||||
List<Artifact> artifacts = new ArrayList<>( searchResults.getReturnedHitsCount() );
|
||||
for ( SearchResultHit hit : searchResults.getHits() )
|
||||
{
|
||||
// duplicate Artifact one per available version
|
||||
|
@ -34,7 +34,7 @@
|
||||
public class AddAdminRepoConsumerClosure
|
||||
implements Closure
|
||||
{
|
||||
private List<AdminRepositoryConsumer> list = new ArrayList<AdminRepositoryConsumer>();
|
||||
private List<AdminRepositoryConsumer> list = new ArrayList<>();
|
||||
|
||||
private List<String> selectedIds;
|
||||
|
||||
|
@ -72,7 +72,7 @@ public SyndFeed generateFeed( String title, String description, List<RssFeedEntr
|
||||
|
||||
private List<SyndEntry> getEntries( List<RssFeedEntry> dataEntries )
|
||||
{
|
||||
List<SyndEntry> entries = new ArrayList<SyndEntry>();
|
||||
List<SyndEntry> entries = new ArrayList<>();
|
||||
|
||||
SyndEntry entry;
|
||||
SyndContent description;
|
||||
|
@ -102,7 +102,7 @@ private SyndFeed processNewArtifactsInRepo( String repoId, MetadataRepository me
|
||||
|
||||
long tmp = 0;
|
||||
RssFeedEntry entry = null;
|
||||
List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>();
|
||||
List<RssFeedEntry> entries = new ArrayList<>();
|
||||
String description = "";
|
||||
int idx = 0;
|
||||
for ( ArtifactMetadata artifact : artifacts )
|
||||
|
@ -81,7 +81,7 @@ private SyndFeed processNewVersionsOfArtifact( String groupId, String artifactId
|
||||
MetadataRepository metadataRepository )
|
||||
throws FeedException
|
||||
{
|
||||
List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>();
|
||||
List<ArtifactMetadata> artifacts = new ArrayList<>();
|
||||
try
|
||||
{
|
||||
for ( String repoId : metadataRepository.getRepositories() )
|
||||
@ -106,7 +106,7 @@ private SyndFeed processNewVersionsOfArtifact( String groupId, String artifactId
|
||||
|
||||
long tmp = 0;
|
||||
RssFeedEntry entry = null;
|
||||
List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>();
|
||||
List<RssFeedEntry> entries = new ArrayList<>();
|
||||
String description = "";
|
||||
int idx = 0;
|
||||
for ( ArtifactMetadata artifact : artifacts )
|
||||
|
@ -57,7 +57,7 @@ public void setUp()
|
||||
public void testNewFeed()
|
||||
throws Exception
|
||||
{
|
||||
List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>();
|
||||
List<RssFeedEntry> entries = new ArrayList<>();
|
||||
RssFeedEntry entry = new RssFeedEntry( "Item 1" );
|
||||
|
||||
Date whenGathered = new Date( System.currentTimeMillis() );
|
||||
@ -95,7 +95,7 @@ public void testNewFeed()
|
||||
public void testNoDataEntries()
|
||||
throws Exception
|
||||
{
|
||||
List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>();
|
||||
List<RssFeedEntry> entries = new ArrayList<>();
|
||||
SyndFeed feed =
|
||||
generator.generateFeed( "Test Feed", "The test feed from Archiva.", entries );
|
||||
|
||||
|
@ -72,7 +72,7 @@ public void setUp()
|
||||
public void testProcess()
|
||||
throws Exception
|
||||
{
|
||||
List<ArtifactMetadata> newArtifacts = new ArrayList<ArtifactMetadata>();
|
||||
List<ArtifactMetadata> newArtifacts = new ArrayList<>();
|
||||
Date whenGathered = Calendar.getInstance().getTime();
|
||||
|
||||
newArtifacts.add( createArtifact( "artifact-one", "1.0", whenGathered ) );
|
||||
|
@ -81,7 +81,7 @@ private List<String> getAccessibleRepositoryIds( String principal, String operat
|
||||
{
|
||||
|
||||
List<ManagedRepository> managedRepositories = getAccessibleRepositories( principal, operation );
|
||||
List<String> repoIds = new ArrayList<String>( managedRepositories.size() );
|
||||
List<String> repoIds = new ArrayList<>( managedRepositories.size() );
|
||||
for ( ManagedRepository managedRepository : managedRepositories )
|
||||
{
|
||||
repoIds.add( managedRepository.getId() );
|
||||
@ -101,7 +101,7 @@ private List<ManagedRepository> getAccessibleRepositories( String principal, Str
|
||||
{
|
||||
SecuritySession securitySession = createSession( principal );
|
||||
|
||||
List<ManagedRepository> managedRepositories = new ArrayList<ManagedRepository>();
|
||||
List<ManagedRepository> managedRepositories = new ArrayList<>();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -604,7 +604,7 @@ private void updateProjectMetadata( String targetPath, Date lastUpdatedTimestamp
|
||||
String artifactId, String version, String packaging )
|
||||
throws RepositoryMetadataException
|
||||
{
|
||||
List<String> availableVersions = new ArrayList<String>();
|
||||
List<String> availableVersions = new ArrayList<>();
|
||||
String latestVersion = version;
|
||||
|
||||
File projectDir = new File( targetPath ).getParentFile();
|
||||
|
@ -240,7 +240,7 @@ private boolean isAllowed( HttpServletRequest req, String repositoryId, String g
|
||||
UnauthorizedException
|
||||
{
|
||||
String auth = req.getHeader( "Authorization" );
|
||||
List<String> repoIds = new ArrayList<String>();
|
||||
List<String> repoIds = new ArrayList<>();
|
||||
|
||||
if ( repositoryId != null )
|
||||
{
|
||||
|
@ -259,7 +259,7 @@ public User getGuestUser()
|
||||
public List<User> findUsersByEmailKey( String emailKey, boolean orderAscending )
|
||||
throws UserManagerException
|
||||
{
|
||||
List<User> users = new ArrayList<User>();
|
||||
List<User> users = new ArrayList<>();
|
||||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
@ -275,7 +275,7 @@ public List<User> findUsersByEmailKey( String emailKey, boolean orderAscending )
|
||||
public List<User> findUsersByFullNameKey( String fullNameKey, boolean orderAscending )
|
||||
throws UserManagerException
|
||||
{
|
||||
List<User> users = new ArrayList<User>();
|
||||
List<User> users = new ArrayList<>();
|
||||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
@ -291,7 +291,7 @@ public List<User> findUsersByFullNameKey( String fullNameKey, boolean orderAscen
|
||||
public List<User> findUsersByQuery( UserQuery query )
|
||||
throws UserManagerException
|
||||
{
|
||||
List<User> users = new ArrayList<User>();
|
||||
List<User> users = new ArrayList<>();
|
||||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
@ -307,7 +307,7 @@ public List<User> findUsersByQuery( UserQuery query )
|
||||
public List<User> findUsersByUsernameKey( String usernameKey, boolean orderAscending )
|
||||
throws UserManagerException
|
||||
{
|
||||
List<User> users = new ArrayList<User>();
|
||||
List<User> users = new ArrayList<>();
|
||||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
@ -328,7 +328,7 @@ public String getId()
|
||||
public List<User> getUsers()
|
||||
throws UserManagerException
|
||||
{
|
||||
List<User> users = new ArrayList<User>();
|
||||
List<User> users = new ArrayList<>();
|
||||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
@ -344,7 +344,7 @@ public List<User> getUsers()
|
||||
public List<User> getUsers( boolean orderAscending )
|
||||
throws UserManagerException
|
||||
{
|
||||
List<User> users = new ArrayList<User>();
|
||||
List<User> users = new ArrayList<>();
|
||||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ public void setLdapGroupMappings( Map<String, List<String>> mappings )
|
||||
RedbackRuntimeConfiguration redbackRuntimeConfiguration =
|
||||
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
|
||||
|
||||
List<LdapGroupMapping> ldapGroupMappings = new ArrayList<LdapGroupMapping>( mappings.size() );
|
||||
List<LdapGroupMapping> ldapGroupMappings = new ArrayList<>( mappings.size() );
|
||||
|
||||
for ( Map.Entry<String, List<String>> entry : mappings.entrySet() )
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ protected void initialize()
|
||||
List<String> userManagerImpls =
|
||||
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls();
|
||||
|
||||
userManagers = new ArrayList<UserManager>( userManagerImpls.size() );
|
||||
userManagers = new ArrayList<>( userManagerImpls.size() );
|
||||
|
||||
for ( String beanId : userManagerImpls )
|
||||
{
|
||||
@ -100,7 +100,7 @@ public void validateEnvironment( List<String> violations )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
List<String> roles = new ArrayList<String>();
|
||||
List<String> roles = new ArrayList<>();
|
||||
roles.add( RedbackRoleConstants.SYSTEM_ADMINISTRATOR_ROLE );
|
||||
|
||||
List<UserAssignment> systemAdminstrators;
|
||||
|
@ -250,7 +250,7 @@ public List<Role> getAllRoles()
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
|
||||
return new ArrayList<Role>( allRoles.values() );
|
||||
return new ArrayList<>( allRoles.values() );
|
||||
}
|
||||
|
||||
public void removeRole( Role role )
|
||||
@ -381,7 +381,7 @@ public List<Permission> getAllPermissions()
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return new ArrayList<Permission>( allPermissions.values() );
|
||||
return new ArrayList<>( allPermissions.values() );
|
||||
}
|
||||
|
||||
public void removePermission( Permission permission )
|
||||
@ -505,7 +505,7 @@ public List<Operation> getAllOperations()
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return new ArrayList<Operation>( allOperations.values() );
|
||||
return new ArrayList<>( allOperations.values() );
|
||||
}
|
||||
|
||||
public void removeOperation( Operation operation )
|
||||
@ -629,7 +629,7 @@ public List<Resource> getAllResources()
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return new ArrayList<Resource>( allResources.values() );
|
||||
return new ArrayList<>( allResources.values() );
|
||||
}
|
||||
|
||||
public void removeResource( Resource resource )
|
||||
@ -820,13 +820,13 @@ public List<UserAssignment> getAllUserAssignments()
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return new ArrayList<UserAssignment>( allUserAssignments.values() );
|
||||
return new ArrayList<>( allUserAssignments.values() );
|
||||
}
|
||||
|
||||
public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
|
||||
throws RbacManagerException
|
||||
{
|
||||
List<UserAssignment> allUserAssignments = new ArrayList<UserAssignment>();
|
||||
List<UserAssignment> allUserAssignments = new ArrayList<>();
|
||||
boolean allFailed = true;
|
||||
Exception lastException = null;
|
||||
for ( RBACManager rbacManager : rbacManagersPerId.values() )
|
||||
|
@ -78,7 +78,7 @@ public void initialize()
|
||||
List<String> userManagerImpls =
|
||||
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls();
|
||||
|
||||
userManagers = new ArrayList<UserManager>( userManagerImpls.size() );
|
||||
userManagers = new ArrayList<>( userManagerImpls.size() );
|
||||
|
||||
for ( String beanId : userManagerImpls )
|
||||
{
|
||||
@ -99,7 +99,7 @@ public AuthenticationResult authenticate( AuthenticationDataSource ds )
|
||||
String username = null;
|
||||
Exception resultException = null;
|
||||
PasswordBasedAuthenticationDataSource source = (PasswordBasedAuthenticationDataSource) ds;
|
||||
List<AuthenticationFailureCause> authnResultErrors = new ArrayList<AuthenticationFailureCause>();
|
||||
List<AuthenticationFailureCause> authnResultErrors = new ArrayList<>();
|
||||
|
||||
for ( UserManager userManager : userManagers )
|
||||
{
|
||||
|
@ -181,12 +181,12 @@ private void executeEnvironmentChecks()
|
||||
stopWatch.reset();
|
||||
stopWatch.start();
|
||||
|
||||
List<String> violations = new ArrayList<String>();
|
||||
List<String> violations = new ArrayList<>();
|
||||
|
||||
for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() )
|
||||
{
|
||||
EnvironmentCheck check = entry.getValue();
|
||||
List<String> v = new ArrayList<String>();
|
||||
List<String> v = new ArrayList<>();
|
||||
check.validateEnvironment( v );
|
||||
log.info( "Environment Check: {} -> {} violation(s)", entry.getKey(), v.size() );
|
||||
for ( String s : v )
|
||||
|
@ -294,7 +294,7 @@ protected List<String> getZipEntriesNames( ZipFile zipFile )
|
||||
{
|
||||
try
|
||||
{
|
||||
List<String> entriesNames = new ArrayList<String>();
|
||||
List<String> entriesNames = new ArrayList<>();
|
||||
Enumeration<? extends ZipEntry> entries = zipFile.entries();
|
||||
while ( entries.hasMoreElements() )
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ public class SecuritySystemStub
|
||||
{
|
||||
Map<String, String> users = new HashMap<String, String>();
|
||||
|
||||
List<String> repoIds = new ArrayList<String>();
|
||||
List<String> repoIds = new ArrayList<>();
|
||||
|
||||
public SecuritySystemStub()
|
||||
{
|
||||
|
@ -40,9 +40,9 @@ public class TestMetadataRepository
|
||||
|
||||
private static final String TEST_NAMESPACE = "org.apache.archiva";
|
||||
|
||||
private List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>();
|
||||
private List<ArtifactMetadata> artifacts = new ArrayList<>();
|
||||
|
||||
private List<String> versions = new ArrayList<String>();
|
||||
private List<String> versions = new ArrayList<>();
|
||||
|
||||
public TestMetadataRepository()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user