diff src/goodjava/lucene/backup/Backup.java @ 1677:ea7075b7afe1

switch to index.json
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 31 May 2022 14:36:16 -0600
parents af18eacf187c
children aff2309ae510
line wrap: on
line diff
--- a/src/goodjava/lucene/backup/Backup.java	Mon May 30 19:29:32 2022 -0600
+++ b/src/goodjava/lucene/backup/Backup.java	Tue May 31 14:36:16 2022 -0600
@@ -25,11 +25,11 @@
 	private static final Logger logger = LoggerFactory.getLogger(Backup.class);
 
 	private final File dir;
-	private final File index;
+	private final File indexFile;
 
 	Backup(File dir) {
 		this.dir = dir;
-		this.index = new File(dir,"index");
+		this.indexFile = new File(dir,"index.json");
 		dir.setLastModified(System.currentTimeMillis());
 	}
 
@@ -98,7 +98,7 @@
 			if( checksumObj != null ) {
 				long checksum = (Long)checksumObj;
 				if( log.checksum() != checksum ) {
-					index.delete();
+					indexFile.delete();
 					result = new RpcResult(new Object[]{"bad_checksum",name});
 					break;
 				}
@@ -118,7 +118,7 @@
 				logs[i] = new LogFile(f);
 			}
 			if( complete ) {
-				LoggingIndexWriter.writeIndex(logs,index);
+				LoggingIndexWriter.writeIndex(logs,indexFile);
 				//logger.info("write index");
 			}
 		}