[Geoip-java] FW: assistance
Brought to you by:
tjmather
|
From: Akwad H. <ken...@ho...> - 2011-06-09 16:45:24
|
Dear great developers, Please kindly help on the subject below. From: Akwad Hussein [mailto:ken...@ho...] Sent: Thursday, June 09, 2011 5:43 PM To: 'geo...@li...' Subject: assistance Good day the great developers, I am currently running a job test which I was ask to submit tomorrow, but I don't have a clear idea of the problem. Please kindly help out. Here is the question bellow. PRACTICAL JAVA TEST: I have attached a zip file containing the files 1. geoip.jar 2. GeoIPLite.dat 3. CountryLookupTest.java These are written by a company called maxmind and are used to work out what country a person comes from based on their IP address. The geoip.jar file is the actual code used to access the database/file which is GeoIPLite. The CountryLookupTest.java is a sample of how to use the classes I would like you to write a class that can determine the country based on the IP address using these files. It should have a function getCountry(String ip) and return the 2 letter country code 1. This class would be used by other classes to determine the country based on an IP address 2. e.g. from a webserver It must 1. Only load the Databasefile once into memory Provide us with 2 classes 1. Your class you use to implement the getCountry Function 2. A second class that instantiates this class and gets the country for a few ip addresses 3. Must be written in java I was provided the three file as an attachments, please how do I go about the question Your assistance will be highly appreciated. Thanks. Akwad. |