private void writeLookupTableFile ( List < String > tableNums , Path dir , String writeDate ) throws IOException { System . out . println ( "Writing: lookupTables.txt" ) ; Collections . sort ( tableNums ) ; Path lookupTableReg = dir . resolve ( "lookupTables.txt" ) ; Files . deleteIfExists ( lookupTableReg ) ; Files . createFile ( lookupTableReg ) ; try ( BufferedWriter writer = Files . newBufferedWriter ( lookupTableReg , ENCODING ) ) { writer . write ( "# Generated by " + this . getClass ( ) . getCanonicalName ( ) + " on " + writeDate ) ; writer . newLine ( ) ; for ( String tn : tableNums ) { String tableName = "2.98." + tn + ".table" ; String reg = "98:\t-1:\t" + tn + ":\t" + tableName ; writer . write ( reg ) ; writer . newLine ( ) ; } } }
Write the lookupTables . txt file which basically registers all of the new grib1 tables with the CDM