java.lang.Object
net.i2p.router.time.Zones
Country to continent mapping for NTP. Logging is unavailable here: Zones is built from the RouterClock constructor and logging would recurse.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final I2PAppContextThe context reading the zone files.NTP region by upper case continent code.NTP region by lower case country code.private static final StringBundled file mapping continents to NTP regions.private static final String[]Ref: NTP zone listConstructor Summary
ConstructorsConstructorDescriptionZones(I2PAppContext ctx) Reads in the file in the constructor, so hold onto this.Method Summary
Modifier and TypeMethodDescriptionNTP zone for a country.private voidRead in and parse the continent file.
Field Details
_context
The context reading the zone files._countryToZone
_continentToZone
CONTINENT_FILE_DEFAULT
Bundled file mapping continents to NTP regions.- See Also:
ZONES
Ref: NTP zone list
Constructor Details
Zones
Reads in the file in the constructor, so hold onto this.- Parameters:
ctx- the app context used to locate the country-to-continent data file
Method Details
getZone
readContinentFile
private void readContinentFile()Read in and parse the continent file. The file need not be sorted.Format: #comment (# must be in column 1) country code,continent code
Example: US,NA
Modified from
GeoIP.readCountryFile()ref: NTP zone list