Skip to content
Browse files

imported 1.2.8

  • Loading branch information...
1 parent a61dc5c commit e17fc9f18f8a02a117b63407007fbe84bfd1a79c @kohsuke committed
View
9 Changes
@@ -1,3 +1,12 @@
+1.2.8 Apr 13th 2012
+ - Fix: Close the database file without exceptions whether it is
+ open(STANDARD) or not(MEMORY_CACHE) in conjunction with the
+ CHECK_CACHE option. (Lorenzo Crosby)
+1.2.7 Apr 10th 2012
+ - Update timezones ( Boris Zentner )
+ - Update FIPS codes 20120402 ( Boris Zentner )
+1.2.6 Mar 28th 2012
+ - Update country codes, FIPS codes and timezone ( Boris Zentner )
1.2.5 Aug 23th 2011
- Fix small buffer issue when java tries to read over the EOF ( Boris Zentner )
- Add support for new database types NETSPEED_EDITION_REV1_V6,
View
3 admin/generate_timeZone.pl
@@ -29,7 +29,8 @@ END
while ($str = <FILE>) {
$str =~ s!\s*$!!;
- my ($country,$region,$timezone) = split("\t",$str);
+ my ($country,$region,$timezone) = split(/\t/,$str);
+ die "Wrong timezone\n" unless $timezone;
if ($country ne $old_country) {
if ($had_region) {
print " }\n";
View
126 source/com/maxmind/geoip/LookupService.java
@@ -129,78 +129,61 @@
private static final HashMap hashmapcountryCodetoindex = new HashMap(512);
private static final HashMap hashmapcountryNametoindex = new HashMap(512);
private static final String[] countryCode = {
- "--","AP","EU","AD","AE","AF","AG","AI","AL","AM","AN","AO","AQ","AR",
- "AS","AT","AU","AW","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ",
- "BM","BN","BO","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF",
- "CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CX","CY","CZ",
- "DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI",
- "FJ","FK","FM","FO","FR","FX","GA","GB","GD","GE","GF","GH","GI","GL",
- "GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR",
- "HT","HU","ID","IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO","JP",
- "KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC",
- "LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","MG","MH","MK",
- "ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY",
- "MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM",
- "PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY",
- "QA","RE","RO","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ",
- "SK","SL","SM","SN","SO","SR","ST","SV","SY","SZ","TC","TD","TF","TG",
- "TH","TJ","TK","TM","TN","TO","TL","TR","TT","TV","TW","TZ","UA","UG",
- "UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE",
- "YT","RS","ZA","ZM","ME","ZW","A1","A2","O1","AX","GG","IM","JE","BL",
- "MF"};
+ "--","AP","EU","AD","AE","AF","AG","AI","AL","AM","CW",
+ "AO","AQ","AR","AS","AT","AU","AW","AZ","BA","BB",
+ "BD","BE","BF","BG","BH","BI","BJ","BM","BN","BO",
+ "BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD",
+ "CF","CG","CH","CI","CK","CL","CM","CN","CO","CR",
+ "CU","CV","CX","CY","CZ","DE","DJ","DK","DM","DO",
+ "DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ",
+ "FK","FM","FO","FR","SX","GA","GB","GD","GE","GF",
+ "GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT",
+ "GU","GW","GY","HK","HM","HN","HR","HT","HU","ID",
+ "IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO",
+ "JP","KE","KG","KH","KI","KM","KN","KP","KR","KW",
+ "KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT",
+ "LU","LV","LY","MA","MC","MD","MG","MH","MK","ML",
+ "MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV",
+ "MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI",
+ "NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF",
+ "PG","PH","PK","PL","PM","PN","PR","PS","PT","PW",
+ "PY","QA","RE","RO","RU","RW","SA","SB","SC","SD",
+ "SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO",
+ "SR","ST","SV","SY","SZ","TC","TD","TF","TG","TH",
+ "TJ","TK","TM","TN","TO","TL","TR","TT","TV","TW",
+ "TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE",
+ "VG","VI","VN","VU","WF","WS","YE","YT","RS","ZA",
+ "ZM","ME","ZW","A1","A2","O1","AX","GG","IM","JE",
+ "BL","MF", "BQ"};
private static final String[] countryName = {
- "N/A","Asia/Pacific Region","Europe","Andorra","United Arab Emirates",
- "Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia",
- "Netherlands Antilles","Angola","Antarctica","Argentina","American Samoa",
- "Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina",
- "Barbados","Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain",
- "Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia","Brazil","Bahamas",
- "Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada",
- "Cocos (Keeling) Islands","Congo, The Democratic Republic of the",
- "Central African Republic","Congo","Switzerland","Cote D'Ivoire",
- "Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica","Cuba",
- "Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany",
- "Djibouti","Denmark","Dominica","Dominican Republic","Algeria","Ecuador",
- "Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland",
- "Fiji","Falkland Islands (Malvinas)","Micronesia, Federated States of",
- "Faroe Islands","France","France, Metropolitan","Gabon","United Kingdom",
- "Grenada","Georgia","French Guiana","Ghana","Gibraltar","Greenland","Gambia",
- "Guinea","Guadeloupe","Equatorial Guinea","Greece",
- "South Georgia and the South Sandwich Islands","Guatemala","Guam",
- "Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands",
- "Honduras","Croatia","Haiti","Hungary","Indonesia","Ireland","Israel","India",
- "British Indian Ocean Territory","Iraq","Iran, Islamic Republic of",
- "Iceland","Italy","Jamaica","Jordan","Japan","Kenya","Kyrgyzstan","Cambodia",
- "Kiribati","Comoros","Saint Kitts and Nevis",
- "Korea, Democratic People's Republic of","Korea, Republic of","Kuwait",
- "Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon",
- "Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania",
- "Luxembourg","Latvia","Libyan Arab Jamahiriya","Morocco","Monaco",
- "Moldova, Republic of","Madagascar","Marshall Islands",
- "Macedonia","Mali","Myanmar","Mongolia",
- "Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat",
- "Malta","Mauritius","Maldives","Malawi","Mexico","Malaysia","Mozambique",
- "Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua",
- "Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama",
- "Peru","French Polynesia","Papua New Guinea","Philippines","Pakistan",
- "Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","" +
- "Palestinian Territory","Portugal","Palau","Paraguay","Qatar",
- "Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia",
- "Solomon Islands","Seychelles","Sudan","Sweden","Singapore","Saint Helena",
- "Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino",
- "Senegal","Somalia","Suriname","Sao Tome and Principe","El Salvador",
- "Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad",
- "French Southern Territories","Togo","Thailand","Tajikistan","Tokelau",
- "Turkmenistan","Tunisia","Tonga","Timor-Leste","Turkey","Trinidad and Tobago",
- "Tuvalu","Taiwan","Tanzania, United Republic of","Ukraine","Uganda",
- "United States Minor Outlying Islands","United States","Uruguay","Uzbekistan",
- "Holy See (Vatican City State)","Saint Vincent and the Grenadines",
- "Venezuela","Virgin Islands, British","Virgin Islands, U.S.","Vietnam",
- "Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia",
- "South Africa","Zambia","Montenegro","Zimbabwe","Anonymous Proxy",
- "Satellite Provider","Other","Aland Islands","Guernsey","Isle of Man","Jersey",
- "Saint Barthelemy","Saint Martin"};
+ "N/A","Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Curacao",
+ "Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados",
+ "Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia",
+ "Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos (Keeling) Islands","Congo, The Democratic Republic of the",
+ "Central African Republic","Congo","Switzerland","Cote D'Ivoire","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica",
+ "Cuba","Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany","Djibouti","Denmark","Dominica","Dominican Republic",
+ "Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji",
+ "Falkland Islands (Malvinas)","Micronesia, Federated States of","Faroe Islands","France","Sint Maarten (Dutch part)","Gabon","United Kingdom","Grenada","Georgia","French Guiana",
+ "Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala",
+ "Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia",
+ "Ireland","Israel","India","British Indian Ocean Territory","Iraq","Iran, Islamic Republic of","Iceland","Italy","Jamaica","Jordan",
+ "Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis","Korea, Democratic People's Republic of","Korea, Republic of","Kuwait",
+ "Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania",
+ "Luxembourg","Latvia","Libya","Morocco","Monaco","Moldova, Republic of","Madagascar","Marshall Islands","Macedonia","Mali",
+ "Myanmar","Mongolia","Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives",
+ "Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua",
+ "Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia",
+ "Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestinian Territory","Portugal","Palau",
+ "Paraguay","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan",
+ "Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname",
+ "Sao Tome and Principe","El Salvador","Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand",
+ "Tajikistan","Tokelau","Turkmenistan","Tunisia","Tonga","Timor-Leste","Turkey","Trinidad and Tobago","Tuvalu","Taiwan",
+ "Tanzania, United Republic of","Ukraine","Uganda","United States Minor Outlying Islands","United States","Uruguay","Uzbekistan","Holy See (Vatican City State)","Saint Vincent and the Grenadines","Venezuela",
+ "Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia","South Africa",
+ "Zambia","Montenegro","Zimbabwe","Anonymous Proxy","Satellite Provider","Other","Aland Islands","Guernsey","Isle of Man","Jersey",
+ "Saint Barthelemy","Saint Martin", "Bonaire, Saint Eustatius and Saba"
+ };
/* init the hashmap once at startup time */
@@ -406,7 +389,6 @@ else if (databaseType == DatabaseInfo.CITY_EDITION_REV0 ||
} else {
index_cache = null;
}
-
}
/**
@@ -592,7 +574,7 @@ synchronized void _check_mtime(){
if (t != mtime){
/* GeoIP Database file updated */
/* refresh filehandle */
- file.close();
+ close();
file = new RandomAccessFile(databaseFile,"r");
databaseInfo = null;
init();
View
127 source/com/maxmind/geoip/regionName.java
@@ -1031,6 +1031,12 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 12:
name = "Vlaams-Brabant";
break;
+ case 13:
+ name = "Flanders";
+ break;
+ case 14:
+ name = "Wallonia";
+ break;
}
}
if (country_code.equals("BF") == true) {
@@ -2272,15 +2278,6 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 4:
name = "Atlantico";
break;
- case 5:
- name = "Bolivar Department";
- break;
- case 6:
- name = "Boyaca Department";
- break;
- case 7:
- name = "Caldas Department";
- break;
case 8:
name = "Caqueta";
break;
@@ -2308,9 +2305,6 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 17:
name = "La Guajira";
break;
- case 18:
- name = "Magdalena Department";
- break;
case 19:
name = "Meta";
break;
@@ -5149,18 +5143,12 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 5:
name = "Jambi";
break;
- case 6:
- name = "Jawa Barat";
- break;
case 7:
name = "Jawa Tengah";
break;
case 8:
name = "Jawa Timur";
break;
- case 9:
- name = "Papua";
- break;
case 10:
name = "Yogyakarta";
break;
@@ -5179,36 +5167,21 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 15:
name = "Lampung";
break;
- case 16:
- name = "Maluku";
- break;
case 17:
name = "Nusa Tenggara Barat";
break;
case 18:
name = "Nusa Tenggara Timur";
break;
- case 19:
- name = "Riau";
- break;
- case 20:
- name = "Sulawesi Selatan";
- break;
case 21:
name = "Sulawesi Tengah";
break;
case 22:
name = "Sulawesi Tenggara";
break;
- case 23:
- name = "Sulawesi Utara";
- break;
case 24:
name = "Sumatera Barat";
break;
- case 25:
- name = "Sumatera Selatan";
- break;
case 26:
name = "Sumatera Utara";
break;
@@ -5845,30 +5818,39 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 2:
name = "Al Balqa'";
break;
- case 7:
- name = "Ma";
- break;
case 9:
name = "Al Karak";
break;
- case 10:
- name = "Al Mafraq";
- break;
- case 11:
- name = "Amman Governorate";
- break;
case 12:
name = "At Tafilah";
break;
- case 13:
- name = "Az Zarqa";
- break;
- case 14:
- name = "Irbid";
+ case 15:
+ name = "Al Mafraq";
break;
case 16:
name = "Amman";
break;
+ case 17:
+ name = "Az Zaraqa";
+ break;
+ case 18:
+ name = "Irbid";
+ break;
+ case 19:
+ name = "Ma'an";
+ break;
+ case 20:
+ name = "Ajlun";
+ break;
+ case 21:
+ name = "Al Aqabah";
+ break;
+ case 22:
+ name = "Jarash";
+ break;
+ case 23:
+ name = "Madaba";
+ break;
}
}
if (country_code.equals("JP") == true) {
@@ -7137,6 +7119,9 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 81:
name = "Ocnita";
break;
+ case 82:
+ name = "Orhei";
+ break;
case 83:
name = "Rezina";
break;
@@ -8503,9 +8488,6 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 7:
name = "Noord-Holland";
break;
- case 8:
- name = "Overijssel";
- break;
case 9:
name = "Utrecht";
break;
@@ -10009,8 +9991,11 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 91:
name = "Krasnoyarskiy Kray";
break;
- case 942:
- name = "Chechnya Republic";
+ case 92:
+ name = "Kamchatskiy Kray";
+ break;
+ case 93:
+ name = "Zabaykal'skiy Kray";
break;
}
}
@@ -10050,9 +10035,6 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 2:
name = "Al Bahah";
break;
- case 3:
- name = "Al Jawf";
- break;
case 5:
name = "Al Madinah";
break;
@@ -10062,12 +10044,12 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
case 8:
name = "Al Qasim";
break;
- case 9:
- name = "Al Qurayyat";
- break;
case 10:
name = "Ar Riyad";
break;
+ case 11:
+ name = "Asir Province";
+ break;
case 13:
name = "Ha'il";
break;
@@ -12635,25 +12617,46 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
name = "Shabwah";
break;
case 6:
- name = "Al Ghaydah";
+ name = "Lahij";
+ break;
+ case 7:
+ name = "Al Bayda'";
break;
case 8:
name = "Al Hudaydah";
break;
+ case 9:
+ name = "Al Jawf";
+ break;
case 10:
name = "Al Mahwit";
break;
case 11:
name = "Dhamar";
break;
+ case 12:
+ name = "Hajjah";
+ break;
+ case 13:
+ name = "Ibb";
+ break;
case 14:
name = "Ma'rib";
break;
case 15:
- name = "Sa";
+ name = "Sa'dah";
break;
case 16:
- name = "San";
+ name = "San'a'";
+ break;
+ case 17:
+ name = "Taizz";
+ break;
+ case 18:
+ name = "Ad Dali";
+ break;
+ case 19:
+ name = "Amran";
break;
case 20:
name = "Al Bayda'";
@@ -12671,7 +12674,7 @@ else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65
name = "Lahij";
break;
case 25:
- name = "Ta";
+ name = "Taizz";
break;
}
}
View
1,356 source/com/maxmind/geoip/timeZone.java
706 additions, 650 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit e17fc9f

Please sign in to comment.
Something went wrong with that request. Please try again.