1414import com .maxmind .geoip2 .exception .AddressNotFoundException ;
1515import com .maxmind .geoip2 .model .Country ;
1616import com .maxmind .geoip2 .model .Omni ;
17+ import com .maxmind .maxminddb .MaxMindDbReader ;
1718
1819/**
1920 * Instances of this class provide a reader for the GeoIP2 database format. IP
2223public class DatabaseReader implements Closeable {
2324
2425 // This is sort of annoying. Rename one of the two?
25- private final com . maxmind . maxminddb . Reader reader ;
26+ private final MaxMindDbReader reader ;
2627
2728 private final ObjectMapper om ;
2829
@@ -51,8 +52,9 @@ public DatabaseReader(File database) throws IOException {
5152 * @throws IOException
5253 * if there is an error opening or reading from the file.
5354 */
54- public DatabaseReader (File database , List <String > languages ) throws IOException {
55- this .reader = new com .maxmind .maxminddb .Reader (database );
55+ public DatabaseReader (File database , List <String > languages )
56+ throws IOException {
57+ this .reader = new MaxMindDbReader (database );
5658 this .om = new ObjectMapper ();
5759 this .om .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES ,
5860 false );
@@ -70,8 +72,8 @@ public DatabaseReader(File database, List<String> languages) throws IOException
7072 * @throws AddressNotFoundException
7173 * if the IP address is not in our database
7274 */
73- public <T extends Country > T get (InetAddress ipAddress )
74- throws IOException , AddressNotFoundException {
75+ public <T extends Country > T get (InetAddress ipAddress ) throws IOException ,
76+ AddressNotFoundException {
7577 ObjectNode node = (ObjectNode ) this .reader .get (ipAddress );
7678
7779 // XXX - I am not sure Java programmers would expect an exception here,
0 commit comments