Package com.maxmind.geoip2

Examples of com.maxmind.geoip2.DatabaseReader.country()


    public Country geolocAndGetCountry(final String customerRemoteAddr) throws Exception {
        try {
            final InetAddress address = InetAddress.getByName(customerRemoteAddr);
           
            final DatabaseReader databaseReader = new DatabaseReader.Builder(getCountryDataBase()).build();
            final CountryResponse countryResponse = databaseReader.country(address);
            if(countryResponse != null){
                return countryResponse.getCountry();
            }
        } catch (AddressNotFoundException e) {
            logger.warn("Geoloc country, can't find this address:" + customerRemoteAddr);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.