/** * Parses the source files. * * @throws Exception if an error occurs */ private void parseFiles() throws Exception { for (File file : sourceFiles) { printVerbose("Parsing file: " + file); parseFile(file); } }
/** * Parses the source files. * * @throws Exception if an error occurs */ private void parseFiles() throws Exception { for (File file : sourceFiles) { printVerbose("Parsing file: " + file); parseFile(file); } }
/** * Compile the rules file. * <p> * Use {@link #getZones()} and {@link #getLeapSeconds()} to retrieve the parsed data. * * @throws Exception if an error occurs */ public void compile() throws Exception { printVerbose("Compiling TZDB version " + version); parseFiles(); parseLeapSecondsFile(); buildZoneRules(); printVerbose("Compiled TZDB version " + version); }
/** * Compile the rules file. * <p> * Use {@link #getZones()} and {@link #getLeapSeconds()} to retrieve the parsed data. * * @throws Exception if an error occurs */ public void compile() throws Exception { printVerbose("Compiling TZDB version " + version); parseFiles(); parseLeapSecondsFile(); buildZoneRules(); printVerbose("Compiled TZDB version " + version); }
printVerbose("Parsing leap second file: " + leapSecondsFile); int lineNumber = 1; String line = null;
printVerbose("Parsing leap second file: " + leapSecondsFile); int lineNumber = 1; String line = null;
if (first.equals("Leap")) { if (st.countTokens() < 6) { printVerbose("Invalid leap second line in file: " + leapSecondsFile + ", line: " + line); throw new IllegalArgumentException("Invalid leap second line");
printVerbose("Building zone " + zoneId); zoneId = deduplicate(zoneId); List<TZDBZone> tzdbZones = zones.get(zoneId); aliasId = deduplicate(aliasId); String realId = links.get(aliasId); printVerbose("Linking alias " + aliasId + " to " + realId); ZoneRules realRules = builtZones.get(realId); if (realRules == null) { printVerbose("Relinking alias " + aliasId + " to " + realId); realRules = builtZones.get(realId); if (realRules == null) {
if (first.equals("Leap")) { if (st.countTokens() < 6) { printVerbose("Invalid leap second line in file: " + leapSecondsFile + ", line: " + line); throw new IllegalArgumentException("Invalid leap second line");
if (first.equals("Zone")) { if (st.countTokens() < 3) { printVerbose("Invalid Zone line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Zone line"); if (first.equals("Rule")) { if (st.countTokens() < 9) { printVerbose("Invalid Rule line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Rule line"); printVerbose("Invalid Link line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Link line");
printVerbose("Building zone " + zoneId); zoneId = deduplicate(zoneId); List<TZDBZone> tzdbZones = zones.get(zoneId); aliasId = deduplicate(aliasId); String realId = links.get(aliasId); printVerbose("Linking alias " + aliasId + " to " + realId); ZoneRules realRules = builtZones.get(realId); if (realRules == null) { printVerbose("Relinking alias " + aliasId + " to " + realId); realRules = builtZones.get(realId); if (realRules == null) {
if (first.equals("Zone")) { if (st.countTokens() < 3) { printVerbose("Invalid Zone line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Zone line"); if (first.equals("Rule")) { if (st.countTokens() < 9) { printVerbose("Invalid Rule line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Rule line"); printVerbose("Invalid Link line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Link line");