final File tempRoot = configSource.getTemporaryRootDirectory();
for ( final Iterator<Repository> i = repositoriesList.iterator(); i.hasNext(); )
{
final Repository repository = i.next();
final String outputDirectory =
AssemblyFormatUtils.getOutputDirectory( repository.getOutputDirectory(), configSource.getProject(),
null, configSource.getFinalName(), configSource );
final File repositoryDirectory = new File( tempRoot, outputDirectory );
if ( !repositoryDirectory.exists() )
{
repositoryDirectory.mkdirs();
}
try
{
getLogger().debug( "Assembling repository to: " + repositoryDirectory );
repositoryAssembler.buildRemoteRepository( repositoryDirectory, wrap( repository ), wrap( configSource ) );
getLogger().debug( "Finished assembling repository to: " + repositoryDirectory );
}
catch ( final RepositoryAssemblyException e )
{
throw new ArchiveCreationException( "Failed to assemble repository: " + e.getMessage(), e );
}
final AddDirectoryTask task = new AddDirectoryTask( repositoryDirectory );
final int dirMode = TypeConversionUtils.modeToInt( repository.getDirectoryMode(), getLogger() );
if ( dirMode != -1 )
{
task.setDirectoryMode( dirMode );
}
final int fileMode = TypeConversionUtils.modeToInt( repository.getFileMode(), getLogger() );
if ( fileMode != -1 )
{
task.setFileMode( fileMode );
}