git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755243 13f79535-47bb-0310-9956-ffa450edef68tags/archiva-1.2
@@ -21,6 +21,8 @@ package org.apache.maven.archiva.converter.legacy; | |||
import org.apache.maven.archiva.common.utils.PathUtil; | |||
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; | |||
import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; | |||
import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; | |||
import org.apache.maven.archiva.converter.RepositoryConversionException; | |||
import org.apache.maven.archiva.repository.RepositoryException; | |||
import org.apache.maven.archiva.repository.scanner.RepositoryScanner; | |||
@@ -65,7 +67,7 @@ public class DefaultLegacyRepositoryConverter | |||
private RepositoryScanner repoScanner; | |||
public void convertLegacyRepository( File legacyRepositoryDirectory, File repositoryDirectory, | |||
List fileExclusionPatterns ) | |||
List<String> fileExclusionPatterns ) | |||
throws RepositoryConversionException | |||
{ | |||
try | |||
@@ -85,11 +87,11 @@ public class DefaultLegacyRepositoryConverter | |||
legacyConverterConsumer.setExcludes( fileExclusionPatterns ); | |||
legacyConverterConsumer.setDestinationRepository( repository ); | |||
List knownConsumers = new ArrayList(); | |||
List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); | |||
knownConsumers.add( legacyConverterConsumer ); | |||
List invalidConsumers = Collections.EMPTY_LIST; | |||
List ignoredContent = new ArrayList(); | |||
List<InvalidRepositoryContentConsumer> invalidConsumers = Collections.emptyList(); | |||
List<String> ignoredContent = new ArrayList<String>(); | |||
ignoredContent.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); | |||
repoScanner.scan( legacyRepository, knownConsumers, invalidConsumers, ignoredContent, |
@@ -69,13 +69,13 @@ public class LegacyConverterArtifactConsumer | |||
private ArtifactRepository destinationRepository; | |||
private List includes; | |||
private List<String> includes; | |||
private List excludes; | |||
private List<String> excludes; | |||
public LegacyConverterArtifactConsumer() | |||
{ | |||
includes = new ArrayList(); | |||
includes = new ArrayList<String>(); | |||
includes.add( "**/*.jar" ); | |||
includes.add( "**/*.ear" ); | |||
includes.add( "**/*.war" ); | |||
@@ -93,12 +93,12 @@ public class LegacyConverterArtifactConsumer | |||
} | |||
public List getExcludes() | |||
public List<String> getExcludes() | |||
{ | |||
return excludes; | |||
} | |||
public List getIncludes() | |||
public List<String> getIncludes() | |||
{ | |||
return includes; | |||
} | |||
@@ -139,12 +139,12 @@ public class LegacyConverterArtifactConsumer | |||
return false; | |||
} | |||
public void setExcludes( List excludes ) | |||
public void setExcludes( List<String> excludes ) | |||
{ | |||
this.excludes = excludes; | |||
} | |||
public void setIncludes( List includes ) | |||
public void setIncludes( List<String> includes ) | |||
{ | |||
this.includes = includes; | |||
} |
@@ -42,6 +42,6 @@ public interface LegacyRepositoryConverter | |||
* @throws RepositoryConversionException | |||
*/ | |||
void convertLegacyRepository( File legacyRepositoryDirectory, File destinationRepositoryDirectory, | |||
List fileExclusionPatterns ) | |||
List<String> fileExclusionPatterns ) | |||
throws RepositoryConversionException; | |||
} |
@@ -19,21 +19,19 @@ package org.apache.maven.archiva.converter; | |||
* under the License. | |||
*/ | |||
import java.io.File; | |||
import java.io.IOException; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import org.apache.commons.io.FileUtils; | |||
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; | |||
import org.apache.maven.archiva.converter.legacy.LegacyRepositoryConverter; | |||
import org.apache.maven.artifact.factory.ArtifactFactory; | |||
import org.apache.maven.artifact.repository.ArtifactRepository; | |||
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; | |||
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; | |||
import org.codehaus.plexus.i18n.I18N; | |||
import org.codehaus.plexus.spring.PlexusInSpringTestCase; | |||
import java.io.File; | |||
import java.io.IOException; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
/** | |||
* Test the repository converter. | |||
* | |||
@@ -51,12 +49,6 @@ public class RepositoryConverterTest | |||
private LegacyRepositoryConverter repositoryConverter; | |||
private ArtifactFactory artifactFactory; | |||
private static final int SLEEP_MILLIS = 100; | |||
private I18N i18n; | |||
protected void setUp() | |||
throws Exception | |||
{ | |||
@@ -82,10 +74,6 @@ public class RepositoryConverterTest | |||
targetRepository.setLayout( "default" ); | |||
repositoryConverter = (LegacyRepositoryConverter) lookup( LegacyRepositoryConverter.ROLE, "default" ); | |||
artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE ); | |||
i18n = (I18N) lookup( I18N.ROLE ); | |||
} | |||
protected void tearDown() | |||
@@ -146,7 +134,7 @@ public class RepositoryConverterTest | |||
{ | |||
File legacyRepoDir = new File( sourceRepository.getBasedir() ); | |||
File destRepoDir = new File( targetRepository.getLocation() ); | |||
List excludes = new ArrayList(); | |||
List<String> excludes = new ArrayList<String>(); | |||
repositoryConverter.convertLegacyRepository( legacyRepoDir, destRepoDir, excludes ); | |||
} | |||
} |