public class GeoIP extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GeoIP.GeoIPData
Helper class for storing GeoIP related attributes, and for resolving the attributes according
to the resolution mode.
|
| Constructor and Description |
|---|
GeoIP(String cityPath,
String ispPath)
Initialize new
GeoIP, load databases from specified paths |
| Modifier and Type | Method and Description |
|---|---|
com.maxmind.geoip2.model.CityResponse |
lookupCity(String ip)
Lookup city/country from IP address string
|
com.maxmind.geoip2.model.IspResponse |
lookupIsp(String ip)
Lookup ISP from IP address string
|
public GeoIP(String cityPath, String ispPath)
GeoIP, load databases from specified paths
If you don't want to initialize one of the DB's (City or ISP), pass in `null` as the path.
cityPath - Resource or GCS path to load City database fromispPath - Resource or GCS path to load ISP database frompublic com.maxmind.geoip2.model.CityResponse lookupCity(String ip)
ip - IP address stringCityResponse, or null on failurepublic com.maxmind.geoip2.model.IspResponse lookupIsp(String ip)
ip - IP address stringIspResponse, or null on failureCopyright © 2022. All rights reserved.