* Create olson tzid to metazone mappings from metazoneInfo.res (3.8.1 or later)
*/
private static Map createOlsonToMetaMap() {
// Create olson id to metazone mapping table
HashMap olsonToMeta = null;
UResourceBundle metazoneMappingsBundle = null;
try {
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "metazoneInfo");
metazoneMappingsBundle = bundle.get("metazoneMappings");
} catch (MissingResourceException mre) {
// do nothing
}
if (metazoneMappingsBundle != null) {
String[] tzids = getAvailableIDs();
for (int i = 0; i < tzids.length; i++) {
// Skip aliases
String canonicalID = TimeZone.getCanonicalID(tzids[i]);
if (canonicalID == null || !tzids[i].equals(canonicalID)) {
continue;
}
String tzkey = tzids[i].replace('/', ':');
try {
UResourceBundle zoneBundle = metazoneMappingsBundle.get(tzkey);
LinkedList mzMappings = new LinkedList();
for (int idx = 0; ; idx++) {
try {
UResourceBundle mz = zoneBundle.get("mz" + idx);
String[] mzstr = mz.getStringArray();
if (mzstr == null || mzstr.length != 3) {
continue;
}
OlsonToMetaMappingEntry mzmap = new OlsonToMetaMappingEntry();
mzmap.mzid = mzstr[0].intern();