Skip to content

Commit ff88958

Browse files
committed
Updated reference to the MaxMind DB Reader.
1 parent 7afdbb9 commit ff88958

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/com/maxmind/geoip2/DatabaseReader.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.maxmind.geoip2.exception.AddressNotFoundException;
1515
import com.maxmind.geoip2.model.Country;
1616
import 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
@@ -22,7 +23,7 @@
2223
public 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

Comments
 (0)