public RemoteRepositoryContent getRemoteRepositoryContent( String repoId ) throws RepositoryException { RemoteRepositoryContent repo = remoteContentMap.get( repoId ); if ( repo != null ) { return repo; } else { throw new RepositoryNotFoundException( "Unable to find remote repository configuration for id:" + repoId ); } }
/** * Get the ManagedRepositoryContent object for the repository Id specified. * * @param repoId the repository id to fetch. * @return the ManagedRepositoryContent object associated with the repository id. * @throws RepositoryNotFoundException if the repository id does not exist within the configuration. * @throws RepositoryException the repository content object cannot be loaded due to configuration issue. */ public ManagedRepositoryContent getManagedRepositoryContent( String repoId ) throws RepositoryException { ManagedRepositoryContent repo = managedContentMap.get( repoId ); if ( repo != null ) { return repo; } else { throw new RepositoryNotFoundException( "Unable to find managed repository configuration for id " + repoId ); } }
@Override public void beginScan( ManagedRepository repoConfig, Date whenGathered ) throws ConsumerException { try { ManagedRepository repo = repositoryRegistry.getManagedRepository( repoConfig.getId( ) ); if (repo==null) { throw new RepositoryNotFoundException( "Repository not found: "+repoConfig.getId() ); } this.repository = repo.getContent(); if (this.repository==null) { throw new RepositoryNotFoundException( "Repository content not found: "+repoConfig.getId() ); } this.repositoryDir = Paths.get( repository.getRepoRoot( ) ); this.scanStartTimestamp = System.currentTimeMillis( ); } catch ( RepositoryException e ) { throw new ConsumerException( e.getMessage( ), e ); } }