@Deprecated public IndexingContext addIndexingContext( String id, String repositoryId, File repository, File indexDirectory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers, boolean reclaimIndexOwnership ) throws IOException, UnsupportedExistingLuceneIndexException { IndexingContext context = new DefaultIndexingContext( id, repositoryId, repository, indexDirectory, repositoryUrl, indexUpdateUrl, indexers, reclaimIndexOwnership ); indexingContexts.put( context.getId(), context ); return context; }
public IndexingContext addIndexingContext( String id, String repositoryId, File repository, Directory directory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers ) throws IOException, UnsupportedExistingLuceneIndexException { IndexingContext context = new DefaultIndexingContext( id, repositoryId, repository, directory, repositoryUrl, indexUpdateUrl, indexers, false ); indexingContexts.put( context.getId(), context ); return context; }
@Deprecated public IndexingContext addIndexingContext( String id, String repositoryId, File repository, Directory directory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers, boolean reclaimIndexOwnership ) throws IOException, UnsupportedExistingLuceneIndexException { IndexingContext context = new DefaultIndexingContext( id, repositoryId, repository, directory, repositoryUrl, indexUpdateUrl, indexers, reclaimIndexOwnership ); indexingContexts.put( context.getId(), context ); return context; }
public IndexingContext addIndexingContext( String id, String repositoryId, File repository, File indexDirectory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers ) throws IOException, UnsupportedExistingLuceneIndexException { IndexingContext context = new DefaultIndexingContext( id, repositoryId, repository, indexDirectory, repositoryUrl, indexUpdateUrl, indexers, false ); indexingContexts.put( context.getId(), context ); return context; }
public IndexingContext addIndexingContextForced( String id, String repositoryId, File repository, File indexDirectory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers ) throws IOException { IndexingContext context = null; try { context = new DefaultIndexingContext( id, repositoryId, repository, indexDirectory, repositoryUrl, indexUpdateUrl, indexers, true ); indexingContexts.put( context.getId(), context ); } catch ( UnsupportedExistingLuceneIndexException e ) { // will not be thrown } return context; }
public IndexingContext addIndexingContextForced( String id, String repositoryId, File repository, Directory directory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers ) throws IOException { IndexingContext context = null; try { context = new DefaultIndexingContext( id, repositoryId, repository, directory, repositoryUrl, indexUpdateUrl, indexers, true ); indexingContexts.put( context.getId(), context ); } catch ( UnsupportedExistingLuceneIndexException e ) { // will not be thrown } return context; }
private Map<String, String> getRepositoryMap() { // can't cache this because indexes can be changed Map<String, String> repositories = new HashMap<String, String>(); for ( IndexingContext context : indexer.getIndexingContexts().values() ) { String repositoryUrl = context.getRepositoryUrl(); if ( repositoryUrl != null ) { repositories.put( context.getId(), repositoryUrl ); } } return repositories; }
public void scanningStarted(IndexingContext ctx) { handle = ProgressHandleFactory.createHandle("Indexing Repo : " + (ri!=null? ri.getName() : indexingContext.getId())); if (debug) { writer.println("Indexing Repo : " + (ri!=null? ri.getName():ctx.getId())); writer.println("Index Directory : " + ctx.getIndexDirectory().toString()); writer.println("--------------------------------------------------------"); writer.println("Scanning started at " + SimpleDateFormat.getInstance().format(new Date())); } handle.start(); handle.switchToIndeterminate(); tstart = System.currentTimeMillis(); }
public RepositoryIndexerListener(NexusIndexer nexusIndexer, IndexingContext indexingContext, boolean createZip) { this.indexingContext = indexingContext; this.nexusIndexer = nexusIndexer; this.createZip = createZip; ri = RepositoryPreferences.getInstance().getRepositoryInfoById(indexingContext.getId()); if (debug) { io = IOProvider.getDefault().getIO("Indexing " +(ri!=null? ri.getName():indexingContext.getId()), true); writer = io.getOut(); } }
File targetPropertyFile = new File( request.getTargetDir(), IndexingContext.INDEX_FILE + ".properties" ); info.setProperty( IndexingContext.INDEX_ID, request.getContext().getId() );
File tmpFile = File.createTempFile( context.getId() + "-tmp", "", dir ); File tmpDir = new File( tmpFile.getParentFile(), tmpFile.getName() + ".dir" ); if ( !tmpDir.mkdirs() ) tmpContext = new DefaultIndexingContext( context.getId() + "-tmp", // getLogger().warn( "Error scanning context: " + context.getId(), ex ); throw new IOException( "Error scanning context " + context.getId() + ": " + ex.getMessage() );
public Properties fetchIndexProperties( final IndexingContext context, final ResourceFetcher fetcher ) throws IOException { fetcher.connect( context.getId(), context.getIndexUpdateUrl() ); try { Properties properties = downloadIndexProperties( fetcher ); storeIndexProperties( context.getIndexDirectoryFile(), properties ); return properties; } finally { fetcher.disconnect(); } }
artifactInfo.context = context.getId();
result.context = context.getId();
artifactInfo.context = context.getId();
fetcher.connect( context.getId(), context.getIndexUpdateUrl() );