File tree Expand file tree Collapse file tree
java/com/baeldung/spring/service
test/java/com/baeldung/geoip Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public class RawDBDemoGeoIPLocationService{
1313 private DatabaseReader dbReader ;
1414
1515 public RawDBDemoGeoIPLocationService () throws IOException {
16- File database = new File ("C: \\ Users \\ Parth Joshi \\ Desktop \\ GeoLite2-City.mmdb \\ GeoLite2-City.mmdb " );
16+ File database = new File ("your-path-to-db-file " );
1717 dbReader = new DatabaseReader .Builder (database ).build ();
1818 }
1919
Original file line number Diff line number Diff line change 7777<div id =" status" ></div >
7878
7979<div id =" map" style =" height : 500px ; width :100% ; position :absolute " ></div >
80- <!-- AIzaSyDDr65sVtJtlbliOTAeXyZSDPvG9NROjJA -->
81- <script src =" https://maps.googleapis.com/maps/api/js?key=AIzaSyA4vsDQWHeOrDnzS98XMXl5hgwA9raaQZ8 "
80+
81+ <script src =" https://maps.googleapis.com/maps/api/js?key=YOUR-MAPS-API-KEY "
8282 async defer ></script >
8383</body >
8484</html >
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ public class GeoIpIntegrationTest {
1515
1616 @ Test
1717 public void givenIP_whenFetchingCity_thenReturnsCityData () throws IOException , GeoIp2Exception {
18- File database = new File ("C: \\ Users \\ Parth Joshi \\ Desktop \\ GeoLite2-City.mmdb \\ GeoLite2-City.mmdb " );
18+ File database = new File ("your-path-to-db-file " );
1919 DatabaseReader dbReader = new DatabaseReader .Builder (database ).build ();
2020
21- InetAddress ipAddress = InetAddress .getByName ("202.47.112.9 " );
21+ InetAddress ipAddress = InetAddress .getByName ("your-public-ip " );
2222 CityResponse response = dbReader .city (ipAddress );
2323
2424 String countryName = response .getCountry ().getName ();
You can’t perform that action at this time.
0 commit comments