throw new IllegalArgumentException( "Repository " + repository.getAlias() + " not found" );
}
}
public RepositoryInfo getRepositoryInfo( final String alias ) {
final Repository repo = getRepository( alias );
String ouName = null;
for ( final OrganizationalUnit ou : organizationalUnitService.getOrganizationalUnits() ) {
for ( Repository repository : ou.getRepositories() ) {
if ( repository.getAlias().equals( alias ) ) {
ouName = ou.getName();
}
}
}
final VersionAttributeView versionAttributeView = ioService.getFileAttributeView( convert( repo.getRoot() ), VersionAttributeView.class );
final List<VersionRecord> records = versionAttributeView.readAttributes().history().records();
Collections.reverse( records );
return new RepositoryInfo( alias, ouName, repo.getRoot(), repo.getPublicURIs(), new ArrayList<VersionRecord>( HISTORY_PAGE_SIZE ) {{
int size = 0;
for ( final VersionRecord record : records ) {
add( new PortableVersionRecord( record.id(), record.author(), record.email(), record.comment(), record.date(), record.uri() ) );
size++;
if ( size > HISTORY_PAGE_SIZE ) {