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;
private RepositoryScanner repoScanner;
public void convertLegacyRepository( File legacyRepositoryDirectory, File repositoryDirectory,
- List fileExclusionPatterns )
+ List<String> fileExclusionPatterns )
throws RepositoryConversionException
{
try
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,
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" );
}
- public List getExcludes()
+ public List<String> getExcludes()
{
return excludes;
}
- public List getIncludes()
+ public List<String> getIncludes()
{
return includes;
}
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;
}
* @throws RepositoryConversionException
*/
void convertLegacyRepository( File legacyRepositoryDirectory, File destinationRepositoryDirectory,
- List fileExclusionPatterns )
+ List<String> fileExclusionPatterns )
throws RepositoryConversionException;
}
* 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.
*
private LegacyRepositoryConverter repositoryConverter;
- private ArtifactFactory artifactFactory;
-
- private static final int SLEEP_MILLIS = 100;
-
- private I18N i18n;
-
protected void setUp()
throws Exception
{
targetRepository.setLayout( "default" );
repositoryConverter = (LegacyRepositoryConverter) lookup( LegacyRepositoryConverter.ROLE, "default" );
-
- artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
-
- i18n = (I18N) lookup( I18N.ROLE );
}
protected void tearDown()
{
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 );
}
}