1- # GeoIP2 Java API #
1+ # GeoIP Java API #
22
33## Description ##
44
5- This distribution provides an API for the GeoIP2 and GeoLite2 [ web
5+ This distribution provides an API for the GeoIP and GeoLite [ web
66services] ( https://dev.maxmind.com/geoip/docs/web-services?lang=en ) and
77[ databases] ( https://dev.maxmind.com/geoip/docs/databases?lang=en ) .
88
@@ -43,16 +43,16 @@ file and its dependencies in your classpath. Download the JAR files from the
4343## IP Geolocation Usage ##
4444
4545IP geolocation is inherently imprecise. Locations are often near the center of
46- the population. Any location provided by a GeoIP2 database or web service
46+ the population. Any location provided by a GeoIP database or web service
4747should not be used to identify a particular address or household.
4848
4949## Web Service Usage ##
5050
5151To use the web service API, you must create a new ` WebServiceClient ` using the
5252` WebServiceClient.Builder ` . You must provide the ` Builder ` constructor your
53- MaxMind ` accountId ` and ` licenseKey ` . To use the GeoLite2 web services instead
54- of GeoIP2 , set the ` host ` method on the builder to ` geolite.info ` . To use
55- the Sandbox GeoIP2 web services instead of the production GeoIP2 web
53+ MaxMind ` accountId ` and ` licenseKey ` . To use the GeoLite web services instead
54+ of GeoIP , set the ` host ` method on the builder to ` geolite.info ` . To use
55+ the Sandbox GeoIP web services instead of the production GeoIP web
5656services, set the ` host ` method on the builder to ` sandbox.maxmind.com ` .
5757You may also set a ` timeout ` or set the ` locales ` fallback order using the
5858methods on the ` Builder ` . After you have created the ` WebServiceClient ` ,
@@ -122,10 +122,10 @@ before any intermediary does so.
122122// connections alive for future requests.
123123//
124124// Replace "42" with your account ID and "license_key" with your license key.
125- // To use the GeoLite2 web service instead of the GeoIP2 web service, call the
125+ // To use the GeoLite web service instead of the GeoIP web service, call the
126126// host method on the builder with "geolite.info", e.g.
127127// new WebServiceClient.Builder(42, "license_key").host("geolite.info").build()
128- // To use the Sandbox GeoIP2 web service instead of the production GeoIP2
128+ // To use the Sandbox GeoIP web service instead of the production GeoIP
129129// web service, call the host method on the builder with
130130// "sandbox.maxmind.com", e.g.
131131// new WebServiceClient.Builder(42, "license_key").host("sandbox.maxmind.com").build()
@@ -151,10 +151,10 @@ System.out.println(country.names().get("zh-CN")); // '美国'
151151// connections alive for future requests.
152152//
153153// Replace "42" with your account ID and "license_key" with your license key.
154- // To use the GeoLite2 web service instead of the GeoIP2 web service, call the
154+ // To use the GeoLite web service instead of the GeoIP web service, call the
155155// host method on the builder with "geolite.info", e.g.
156156// new WebServiceClient.Builder(42, "license_key").host("geolite.info").build()
157- // To use the Sandbox GeoIP2 web service instead of the production GeoIP2
157+ // To use the Sandbox GeoIP web service instead of the production GeoIP
158158// web service, call the host method on the builder with
159159// "sandbox.maxmind.com", e.g.
160160// new WebServiceClient.Builder(42, "license_key").host("sandbox.maxmind.com").build()
@@ -194,8 +194,8 @@ System.out.println(location.longitude()); // -93.2323
194194// connections alive for future requests.
195195//
196196// Replace "42" with your account ID and "license_key" with your license key.
197- // Please note that the GeoLite2 web service does not support Insights.
198- // To use the Sandbox GeoIP2 web service instead of the production GeoIP2
197+ // Please note that the GeoLite web service does not support Insights.
198+ // To use the Sandbox GeoIP web service instead of the production GeoIP
199199// web service, call the host method on the builder with
200200// "sandbox.maxmind.com", e.g.
201201// new WebServiceClient.Builder(42, "license_key").host("sandbox.maxmind.com").build()
@@ -239,7 +239,7 @@ System.out.println(response.traits().userType()); // 'college'
239239
240240To use the database API, you must create a new ` DatabaseReader ` using the
241241` DatabaseReader.Builder ` . You must provide the ` Builder ` constructor either an
242- ` InputStream ` or ` File ` for your GeoIP2 database. You may also specify the
242+ ` InputStream ` or ` File ` for your GeoIP database. You may also specify the
243243` fileMode ` and the ` locales ` fallback order using the methods on the ` Builder `
244244object.
245245
@@ -254,7 +254,7 @@ method will be slightly faster as they do not need to construct and throw
254254an exception. These methods otherwise behave the same.
255255
256256If the lookup succeeds, the method call will return a response class for the
257- GeoIP2 lookup. The class in turn contains multiple record classes, each of
257+ GeoIP lookup. The class in turn contains multiple record classes, each of
258258which represents part of the data returned by the database.
259259
260260We recommend reusing the ` DatabaseReader ` object rather than creating a new
@@ -291,7 +291,7 @@ thrown when querying the database.
291291### City ###
292292
293293``` java
294- // A File object pointing to your GeoIP2 or GeoLite2 database
294+ // A File object pointing to your GeoIP or GeoLite database
295295File database = new File (" /path/to/GeoIP2-City.mmdb" );
296296
297297// This creates the DatabaseReader object. To improve performance, reuse
@@ -327,7 +327,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
327327### Anonymous IP ###
328328
329329``` java
330- // A File object pointing to your GeoIP2 Anonymous IP database
330+ // A File object pointing to your GeoIP Anonymous IP database
331331File database = new File (" /path/to/GeoIP2-Anonymous-IP.mmdb" );
332332
333333// This creates the DatabaseReader object. To improve performance, reuse
@@ -349,7 +349,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
349349### Anonymous Plus ###
350350
351351``` java
352- // A File object pointing to your GeoIP2 Anonymous Plus database
352+ // A File object pointing to your GeoIP Anonymous Plus database
353353File database = new File (" /path/to/GeoIP-Anonymous-Plus.mmdb" );
354354
355355// This creates the DatabaseReader object. To improve performance, reuse
@@ -374,7 +374,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
374374### ASN ###
375375
376376``` java
377- // A File object pointing to your GeoLite2 ASN database
377+ // A File object pointing to your GeoLite ASN database
378378File database = new File (" /path/to/GeoLite2-ASN.mmdb" );
379379
380380// This creates the DatabaseReader object. To improve performance, reuse
@@ -393,7 +393,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
393393### Connection-Type ###
394394
395395``` java
396- // A File object pointing to your GeoIP2 Connection-Type database
396+ // A File object pointing to your GeoIP Connection-Type database
397397File database = new File (" /path/to/GeoIP2-Connection-Type.mmdb" );
398398
399399// This creates the DatabaseReader object. To improve performance, reuse
@@ -413,7 +413,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
413413### Domain ###
414414
415415``` java
416- // A File object pointing to your GeoIP2 Domain database
416+ // A File object pointing to your GeoIP Domain database
417417File database = new File (" /path/to/GeoIP2-Domain.mmdb" );
418418
419419// This creates the DatabaseReader object. To improve performance, reuse
@@ -430,7 +430,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
430430### Enterprise ###
431431
432432``` java
433- // A File object pointing to your GeoIP2 Enterprise database
433+ // A File object pointing to your GeoIP Enterprise database
434434File database = new File (" /path/to/GeoIP2-Enterprise.mmdb" );
435435
436436// This creates the DatabaseReader object. To improve performance, reuse
@@ -470,7 +470,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
470470### ISP ###
471471
472472``` java
473- // A File object pointing to your GeoIP2 ISP database
473+ // A File object pointing to your GeoIP ISP database
474474File database = new File (" /path/to/GeoIP2-ISP.mmdb" );
475475
476476// This creates the DatabaseReader object. To improve performance, reuse
@@ -490,7 +490,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
490490## Exceptions ##
491491
492492For details on the possible errors returned by the web service itself, [ see
493- the GeoIP2 web service
493+ the GeoIP web service
494494documentation] ( https://dev.maxmind.com/geoip/docs/web-services?lang=en ) .
495495
496496If the web service returns an explicit error document, this is thrown as an
@@ -550,7 +550,7 @@ databases with data on geographical features around the world, including
550550populated places. They offer both free and paid premium data. Each
551551feature is uniquely identified by a ` geonameId ` , which is an integer.
552552
553- Many of the records returned by the GeoIP2 web services and databases
553+ Many of the records returned by the GeoIP web services and databases
554554include a ` geonameId() ` method. This is the ID of a geographical
555555feature (city, region, country, etc.) in the GeoNames database.
556556
@@ -596,7 +596,7 @@ whenever possible.
596596
597597## Versioning ##
598598
599- The GeoIP2 Java API uses [ Semantic Versioning] ( https://semver.org/ ) .
599+ The GeoIP Java API uses [ Semantic Versioning] ( https://semver.org/ ) .
600600
601601## Copyright and License ##
602602
0 commit comments