/** * Read the table list contained in the input stream * * @param is The input stream * @param aTableList The name of the table list file * @param aTables The list to add the tables into * @return Was successful * @throws IOException On badness */ private static boolean readTableEntries( InputStream is, String aTableList, ArrayList<GribPDSParamTable> aTables) throws IOException { if (is == null) return false; InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line; while ((line = br.readLine()) != null) { line = line.trim(); if ((line.length() == 0) || line.startsWith("#")) { continue; } GribPDSParamTable table = new GribPDSParamTable(); String[] tableDefArr = line.split(":"); table.center_id = Integer.parseInt(tableDefArr[0].trim()); table.subcenter_id = Integer.parseInt(tableDefArr[1].trim()); table.table_number = Integer.parseInt(tableDefArr[2].trim()); table.filename = tableDefArr[3].trim(); if (table.filename.startsWith("/") || table.filename.startsWith("\\") || table.filename.startsWith("file:") || table.filename.startsWith("http://")) { table.path = table.filename; } else if (aTableList != null) { table.path = GribResourceReader.getFileRoot(aTableList); if (table.path.equals(aTableList)) { table.path = table.filename; } else { table.path = table.path + "/" + table.filename; } table.path = table.path.replace('\\', '/'); } aTables.add(table); } is.close(); return true; }