@Override public String getRepoRoot() { return repository.getLocation(); }
@Override public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { this.repositoryDir = new File( repository.getLocation() ); }
@Override public void beginScan( ManagedRepository repo, Date whenGathered ) throws ConsumerException { this.repositoryDir = new File( repo.getLocation() ); }
public RepositoryModelResolver( ManagedRepository managedRepository, RepositoryPathTranslator pathTranslator, WagonFactory wagonFactory, List<RemoteRepository> remoteRepositories, Map<String, NetworkProxy> networkProxiesMap, ManagedRepository targetRepository ) { this( new File( managedRepository.getLocation() ), pathTranslator ); this.managedRepository = managedRepository; this.wagonFactory = wagonFactory; this.remoteRepositories = remoteRepositories; this.networkProxyMap = networkProxiesMap; this.targetRepository = targetRepository; }
@Override public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { this.repositoryDir = new File( repository.getLocation() ); }
@Override public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { this.repositoryDir = new File( repository.getLocation() ); }
@Override public File toFile( ArtifactReference reference ) { return new File( repository.getLocation(), toPath( reference ) ); }
@Override public File toFile( ArchivaArtifact reference ) { return new File( repository.getLocation(), toPath( reference ) ); }
/** * Convert a path to an artifact reference. * * @param path the path to convert. (relative or full location path) * @throws org.apache.archiva.repository.layout.LayoutException if the path cannot be converted to an artifact reference. */ @Override public ArtifactReference toArtifactReference( String path ) throws LayoutException { if ( ( path != null ) && path.startsWith( repository.getLocation() ) && repository.getLocation().length() > 0 ) { return super.toArtifactReference( path.substring( repository.getLocation().length() + 1 ) ); } return super.toArtifactReference( path ); }
@Override public void directoryWalkStarting( File basedir ) { log.info( "Walk Started: [{}] {}", this.repository.getId(), this.repository.getLocation() ); stats.triggerStart(); }
private File getRepositoryBasedir( String repoId ) throws RepositoryStorageRuntimeException { try { ManagedRepository repositoryConfiguration = managedRepositoryAdmin.getManagedRepository( repoId ); return new File( repositoryConfiguration.getLocation() ); } catch ( RepositoryAdminException e ) { throw new RepositoryStorageRuntimeException( "repo-admin", e.getMessage(), e ); } }
Path repoDir = Paths.get( repo.getLocation() ); log.info( "Unable to create missing directory for {}", repo.getLocation() ); continue;
File repoDir = new File( repository.getLocation(), path ); String relativePath = PathUtil.getRelative(repository.getLocation(), repoFile); if ( filetypes.matchesArtifactPattern( relativePath ) )
File repoDir = new File( managedRepository.getLocation() ); File file = pathTranslator.toFile( repoDir, projectArtifact.getGroupId(), projectArtifact.getArtifactId(), projectArtifact.getBaseVersion(),
@Override public void directoryWalkFinished() { TriggerScanCompletedClosure scanCompletedClosure = new TriggerScanCompletedClosure( repository, true ); CollectionUtils.forAllDo( knownConsumers, scanCompletedClosure ); CollectionUtils.forAllDo( invalidConsumers, scanCompletedClosure ); stats.setConsumerTimings( consumerTimings ); stats.setConsumerCounts( consumerCounts ); log.info( "Walk Finished: [{}] {}", this.repository.getId(), this.repository.getLocation() ); stats.triggerFinished(); }
@Override public void directoryWalkStep( int percentage, File file ) { log.debug( "Walk Step: {}, {}", percentage, file ); stats.increaseFileCount(); // consume files regardless - the predicate will check the timestamp BaseFile basefile = new BaseFile( repository.getLocation(), file ); // Timestamp finished points to the last successful scan, not this current one. if ( file.lastModified() >= changesSince ) { stats.increaseNewFileCount(); } consumerProcessFile.setBasefile( basefile ); consumerWantsFile.setBasefile( basefile ); Closure processIfWanted = IfClosure.getInstance( consumerWantsFile, consumerProcessFile ); CollectionUtils.forAllDo( this.knownConsumers, processIfWanted ); if ( consumerWantsFile.getWantedFileCount() <= 0 ) { // Nothing known processed this file. It is invalid! CollectionUtils.forAllDo( this.invalidConsumers, consumerProcessFile ); } }
Path targetPath = Paths.get( repoConfig.getLocation(), path );
File targetPath = new File( repoConfig.getLocation(), path );
String repoLocation = removeExpressions( managedRepository.getLocation() );
@Override public Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo, AuditInformation auditInformation ) throws RepositoryAdminException { getRepositoryCommonValidator().basicValidation( managedRepository, false ); getRepositoryCommonValidator().validateManagedRepository( managedRepository ); triggerAuditEvent( managedRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation ); Boolean res = addManagedRepository( managedRepository.getId(), managedRepository.getLayout(), managedRepository.getName(), managedRepository.getLocation(), managedRepository.isBlockRedeployments(), managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo, managedRepository.getCronExpression(), managedRepository.getIndexDirectory(), managedRepository.getDaysOlder(), managedRepository.getRetentionCount(), managedRepository.isDeleteReleasedSnapshots(), managedRepository.getDescription(), managedRepository.isSkipPackedIndexCreation(), managedRepository.isScanned(), auditInformation, getArchivaConfiguration().getConfiguration() ) != null; createIndexContext( managedRepository ); return res; }