}
private void doConversion( CommandLine cli, PlexusContainer plexus )
throws ComponentLookupException
{
LegacyRepositoryConverter legacyRepositoryConverter = (LegacyRepositoryConverter) plexus
.lookup( LegacyRepositoryConverter.ROLE );
Properties p = new Properties();
try
{
p.load( new FileInputStream( cli.getOptionValue( CONVERT ) ) );
}
catch ( IOException e )
{
showFatalError( "Cannot find properties file which describes the conversion.", e, true );
}
File oldRepositoryPath = new File( p.getProperty( SOURCE_REPO_PATH ) );
File newRepositoryPath = new File( p.getProperty( TARGET_REPO_PATH ) );
System.out.println( "Converting " + oldRepositoryPath + " to " + newRepositoryPath );
List fileExclusionPatterns = null;
String s = p.getProperty( BLACKLISTED_PATTERNS );
if ( s != null )
{
fileExclusionPatterns = Arrays.asList( StringUtils.split( s, "," ) );
}
try
{
legacyRepositoryConverter.convertLegacyRepository( oldRepositoryPath, newRepositoryPath,
fileExclusionPatterns );
}
catch ( RepositoryConversionException e )
{
showFatalError( "Error converting repository.", e, true );