public void beginScan( ArchivaRepository repository )
throws ConsumerException
{
if ( !repository.isManaged() )
{
throw new ConsumerException( "Consumer requires managed repository." );
}
this.repository = repository;
this.repositoryDir = new File( repository.getUrl().getPath() );
this.index = indexFactory.createFileContentIndex( repository );
try
{
this.repositoryLayout = layoutFactory.getLayout( this.repository.getLayoutType() );
}
catch ( LayoutException e )
{
throw new ConsumerException( "Unable to initialize consumer due to unknown repository layout: "
+ e.getMessage(), e );
}
}