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);
} catch (FileNotFoundException e) {
logger.error("Geoloc country, can't find database MaxMind", e);