private String toPath( ArchivaArtifact artifact ) { try { String repoId = artifact.getModel().getRepositoryId(); ManagedRepositoryContent repo = repositoryFactory.getManagedRepositoryContent( repoId ); return repo.toPath( artifact ); } catch ( RepositoryException e ) { log.warn( "Unable to calculate path for artifact: " + artifact ); return ""; } }
private String toPath( ArchivaArtifact artifact ) { try { String repoId = artifact.getModel().getRepositoryId(); ManagedRepositoryContent repo = repositoryFactory.getManagedRepositoryContent( repoId ); return repo.toPath( artifact ); } catch ( RepositoryException e ) { log.warn( "Unable to calculate path for artifact: " + artifact ); return ""; } }
public void beginScan( ManagedRepositoryConfiguration repo ) throws ConsumerException { try { this.repository = repositoryFactory.getManagedRepositoryContent( repo.getId() ); this.repositoryDir = new File( repository.getRepoRoot() ); } catch(RepositoryException e) { throw new ConsumerException( "Unable to start ArtifactUpdateDatabaseConsumer: " + e.getMessage(), e ); } }
public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered ) throws ConsumerException { try { this.repository = repositoryFactory.getManagedRepositoryContent( repo.getId() ); this.repositoryDir = new File( repository.getRepoRoot() ); this.whenGathered = whenGathered; } catch(RepositoryException e) { throw new ConsumerException( "Unable to start ArtifactUpdateDatabaseConsumer: " + e.getMessage(), e ); } }
private ManagedRepositoryContent getRepository( ArchivaArtifact artifact ) throws ConsumerException { String repoId = artifact.getModel().getRepositoryId(); try { return repositoryFactory.getManagedRepositoryContent( repoId ); } catch ( RepositoryException e ) { throw new ConsumerException( "Unable to process project model: " + e.getMessage(), e ); } }
private ManagedRepositoryContent getRepository( ArchivaArtifact artifact ) throws ConsumerException { String repoId = artifact.getModel().getRepositoryId(); try { return repositoryFactory.getManagedRepositoryContent( repoId ); } catch ( RepositoryException e ) { throw new ConsumerException( "Unable to process project model: " + e.getMessage(), e ); } }
private void initRepositoryMap() { synchronized ( this.repositoryMap ) { this.repositoryMap.clear(); Iterator<ManagedRepositoryConfiguration> it = configuration.getConfiguration().getManagedRepositories().iterator(); while ( it.hasNext() ) { ManagedRepositoryConfiguration repository = it.next(); try { IndexedRepositoryDetails pnl = new IndexedRepositoryDetails(); pnl.repository = repositoryFactory.getManagedRepositoryContent( repository.getId() ); pnl.index = indexFactory.createHashcodeIndex( repository ); this.repositoryMap.put( repository.getId(), pnl ); } catch ( RepositoryException e ) { getLogger().error( "Unable to load repository content object: " + e.getMessage(), e ); } } } }
public void beginScan( ManagedRepositoryConfiguration repo ) throws ConsumerException { try { this.repository = repositoryFactory.getManagedRepositoryContent( repo.getId() ); this.repositoryDir = new File( repository.getRepoRoot() ); this.index = indexFactory.createFileContentIndex( repository.getRepository() ); } catch ( RepositoryException e ) { throw new ConsumerException( "Unable to start IndexContentConsumer: " + e.getMessage(), e ); } }
public void processArchivaArtifact( ArchivaArtifact artifact ) throws ConsumerException { try { ManagedRepositoryContent repositoryContent = repositoryFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() ); File file = new File( repositoryContent.getRepoRoot(), repositoryContent.toPath( artifact ) ); if( !file.exists() ) { artifactDAO.deleteArtifact( artifact ); } } catch ( RepositoryException re ) { throw new ConsumerException( "Can't run database cleanup remove artifact consumer: " + re.getMessage() ); } catch ( ArchivaDatabaseException e ) { throw new ConsumerException( e.getMessage() ); } }
repositoryFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() );
repositoryFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() );
repositoryFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() );
repoFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() );