public void writeHeader( IndexingContext context ) throws IOException { dos.writeByte( VERSION ); Date timestamp = context.getTimestamp(); dos.writeLong( timestamp == null ? -1 : timestamp.getTime() ); }
public Date getTimestamp() { return updateRequest.getIndexingContext().getTimestamp(); }
/** * Pack legacy index archive into a specified output stream */ public static void packIndexArchive( IndexingContext context, OutputStream os ) throws IOException { File indexArchive = File.createTempFile( "nexus-index", "" ); File indexDir = new File( indexArchive.getAbsoluteFile().getParentFile(), indexArchive.getName() + ".dir" ); indexDir.mkdirs(); FSDirectory fdir = FSDirectory.getDirectory( indexDir ); try { // force the timestamp update IndexUtils.updateTimestamp( context.getIndexDirectory(), context.getTimestamp() ); IndexUtils.updateTimestamp( fdir, context.getTimestamp() ); copyLegacyDocuments( context.getIndexReader(), fdir, context ); packDirectory( fdir, os ); } finally { IndexUtils.close( fdir ); indexArchive.delete(); IndexUtils.delete( indexDir ); } }
public void scanningFinished(IndexingContext ctx, ScanningResult result) { if (debug) { writer.println("Scanning ended at " + SimpleDateFormat.getInstance().format(new Date())); if (result.hasExceptions()) { writer.printf("Total scanning errors: %s\n", result.getExceptions().size()); } writer.printf("Total files scanned: %s\n", result.getTotalFiles()); long t = System.currentTimeMillis() - tstart; long s = t / 1000L; if (t > 60 * 1000) { long m = t / 1000L / 60L; writer.printf("Total time: %d min %d sec\n", m, s - (m * 60)); } else { writer.printf("Total time: %d sec\n", s); } } if (createZip) { SimpleDateFormat df = new SimpleDateFormat( IndexingContext.INDEX_TIME_FORMAT ); Properties info = new Properties(); info.setProperty( IndexingContext.INDEX_FILE, df.format( ctx.getTimestamp() ) ); writeIndexInfo( info ); createIndexArchive(); } handle.finish(); }
mimeUtil.getMimeType( file ) ) ); if ( context.getTimestamp() == null ) fItem.setModified( context.getTimestamp().getTime() ); fItem.setCreated( context.getTimestamp().getTime() );
Date timestamp = request.getContext().getTimestamp();