For IntelliJ IDEA,
Android Studio or Eclipse



private void myMethod () {IndexingContext i =
Indexer indexer;indexer.createIndexingContext(id, repositoryId, repository, indexDirectory, repositoryUrl, indexUpdateUrl, true, true, indexers)
- Smart code suggestions by Codota
}
@Override public void updateTimestamp(boolean save) throws IOException { delegate.updateTimestamp(save); }
@Override public void updateTimestamp(boolean save, ZonedDateTime time) throws IOException { delegate.updateTimestamp(save, Date.from(time.toInstant())); }
public void index( IndexingContext context, ArtifactContext ac ) throws IOException { // skip artifacts not obeying repository layout (whether m1 or m2) if ( ac != null && ac.getGav() != null ) { Document d = ac.createDocument( context ); if ( d != null ) { context.getIndexWriter().addDocument( d ); context.updateTimestamp(); } } }
public void remove( IndexingContext context, ArtifactContext ac ) throws IOException { if ( ac != null ) { final String uinfo = ac.getArtifactInfo().getUinfo(); // add artifact deletion marker final Document doc = new Document(); doc.add( new Field( ArtifactInfo.DELETED, uinfo, Field.Store.YES, Field.Index.NO ) ); doc.add( new Field( ArtifactInfo.LAST_MODIFIED, // Long.toString( System.currentTimeMillis() ), Field.Store.YES, Field.Index.NO ) ); IndexWriter w = context.getIndexWriter(); w.addDocument( doc ); w.deleteDocuments( new Term( ArtifactInfo.UINFO, uinfo ) ); context.updateTimestamp(); } }
public void update( IndexingContext context, ArtifactContext ac ) throws IOException { if ( ac != null && ac.getGav() != null ) { Document d = ac.createDocument( context ); if ( d != null ) { Document old = getOldDocument( context, ac ); if ( !equals( d, old ) ) { IndexWriter w = context.getIndexWriter(); w.updateDocument( new Term( ArtifactInfo.UINFO, ac.getArtifactInfo().getUinfo() ), d ); updateGroups( context, ac ); context.updateTimestamp(); } } } }
context.updateTimestamp( true );
update, listener ), fromPath ) ); tmpContext.updateTimestamp( true ); context.replace( tmpContext.getIndexDirectory() );
indexingContext.updateTimestamp( true );
update, listener ), fromPath ) ); tmpContext.updateTimestamp( true ); context.replace( tmpContext.getIndexDirectory() );
update, listener ), fromPath ) ); tmpContext.updateTimestamp( true ); context.replace( tmpContext.getIndexDirectory() );
public void remove( IndexingContext context, ArtifactContext ac ) throws IOException { if ( ac != null ) { final String uinfo = ac.getArtifactInfo().getUinfo(); // add artifact deletion marker final Document doc = new Document(); doc.add( new Field( ArtifactInfo.DELETED, uinfo, Field.Store.YES, Field.Index.NO ) ); doc.add( new Field( ArtifactInfo.LAST_MODIFIED, // Long.toString( System.currentTimeMillis() ), Field.Store.YES, Field.Index.NO ) ); IndexWriter w = context.getIndexWriter(); w.addDocument( doc ); w.deleteDocuments( new Term( ArtifactInfo.UINFO, uinfo ) ); context.updateTimestamp(); } }
public void index( IndexingContext context, ArtifactContext ac ) throws IOException { // skip artifacts not obeying repository layout (whether m1 or m2) if ( ac != null && ac.getGav() != null ) { Document d = ac.createDocument( context ); if ( d != null ) { context.getIndexWriter().addDocument( d ); context.updateTimestamp(); } } }
public void update( IndexingContext context, ArtifactContext ac ) throws IOException { if ( ac != null && ac.getGav() != null ) { Document d = ac.createDocument( context ); if ( d != null ) { Document old = getOldDocument( context, ac ); if ( !equals( d, old ) ) { IndexWriter w = context.getIndexWriter(); w.updateDocument( new Term( ArtifactInfo.UINFO, ac.getArtifactInfo().getUinfo() ), d ); updateGroups( context, ac ); context.updateTimestamp(); } } } }
context.updateTimestamp( true );