tornaia / java-offline-geoip

Java Offline GeoIP maps any IP address to its country code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java Offline Geoip

GitHub

Donate

Clear feedback. Just if you appreciate my efforts!

Intro

ISO 3166-1 alpha-2 codes are two-letter country codes defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special areas of geographical interest. Read more

How to use
GeoIP geoIP = GeoIPProvider.getGeoIP();

Optional<String> optionalCountryIsoCode = geoIP.getTwoLetterCountryCode("50.63.202.32");
// optionalCountryIsoCode: Optional[US]

Optional<String> optionalCountryName = geoIP.getCountryName("50.63.202.32");
// optionalCountryName: Optional[United States]
Maven
<dependency>
  <groupId>com.github.tornaia</groupId>
  <artifactId>java-offline-geoip</artifactId>
  <version>0.1.10</version>
</dependency>
Prerequisites for development
Build
  • mvn clean package
License

The GeoLite2 databases are distributed under the Creative Commons Attribution-ShareAlike 4.0 International License. The attribution requirement may be met by including the following in all advertising and documentation mentioning features of or use of this database:

This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.

About

Java Offline GeoIP maps any IP address to its country code

License:Apache License 2.0


Languages

Language:Java 99.9%Language:Batchfile 0.1%