comparison src/goodjava/lucene/logging/LoggingIndexWriter.java @ 1679:39287902fb0c

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 31 May 2022 15:39:58 -0600
parents f54484aae295
children
comparison
equal deleted inserted replaced
1678:f54484aae295 1679:39287902fb0c
71 throw new RuntimeException(); 71 throw new RuntimeException();
72 indexFile = new File(logDir,"index.json"); 72 indexFile = new File(logDir,"index.json");
73 if( indexFile.exists() ) { 73 if( indexFile.exists() ) {
74 try { 74 try {
75 Map map = (Map)JsonParser.parse( IoUtils.readAll(new FileReader(indexFile)) ); 75 Map map = (Map)JsonParser.parse( IoUtils.readAll(new FileReader(indexFile)) );
76 Number num = (Number)map.get("version"); 76 if( ((Number)map.get("version")).intValue() == version ) {
77 if( num != null && num.intValue() == version ) {
78 List fileNames = (List)map.get("files"); 77 List fileNames = (List)map.get("files");
79 for( int i=0; i<logs.length; i++ ) { 78 for( int i=0; i<logs.length; i++ ) {
80 File file = new File( logDir, (String)fileNames.get(i) ); 79 File file = new File( logDir, (String)fileNames.get(i) );
81 logs[i] = new LogFile(file); 80 logs[i] = new LogFile(file);
82 } 81 }