Skip to content

tornaia/java-offline-geoip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.