@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 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 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 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 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 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(); } } }
@Override public void pack( final ArchivaIndexingContext context ) throws IndexUpdateFailedException { executeUpdateFunction( context, indexingContext -> { try { IndexPackingRequest request = new IndexPackingRequest( indexingContext, indexingContext.acquireIndexSearcher( ).getIndexReader( ), indexingContext.getIndexDirectoryFile( ) ); indexPacker.packIndex( request ); indexingContext.updateTimestamp( true ); } catch ( IOException e ) { log.error( "IOException while packing index of context " + context.getId( ) + ( StringUtils.isNotEmpty( e.getMessage( ) ) ? ": " + e.getMessage( ) : "" ) ); throw new IndexUpdateFailedException( "IOException during update of " + context.getId( ), e ); } } ); }
context.updateTimestamp( true );
update, listener ), fromPath ) ); tmpContext.updateTimestamp( true ); context.replace( tmpContext.getIndexDirectory() );
update, listener ), fromPath ) ); tmpContext.updateTimestamp( true ); context.replace( tmpContext.getIndexDirectory() );
update, listener ), fromPath ) ); tmpContext.updateTimestamp( true ); context.replace( tmpContext.getIndexDirectory() );
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(); } } } }
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(); } } } }
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); context.optimize();
context.updateTimestamp( true );
context.updateTimestamp( true );