net.sf.dewdrop.util
Class CountryIsoCodeReader

java.lang.Object
  extended bynet.sf.dewdrop.util.CountryIsoCodeReader

public class CountryIsoCodeReader
extends Object

Very simple, hard-coded utility class that visits the ISO 3166 web site, pulls the list of the countries and their corresponding 2-letter code, and generates sql to insert these pairs into a database. This class must change if the URL changes, or if the file format changes, otherwise it will break.

Author:
Les A. Hazlewood

Field Summary
static String DELIMITER
           
static int HTTP_PORT
           
static String ISO_3166_HOST
           
static String ISO_3166_TXT_FILE_PATH
           
 
Constructor Summary
CountryIsoCodeReader()
           
 
Method Summary
static void main(String[] args)
           
 List retrieveCountries()
          Returns a hashmap of the country names, keyed by their corresponding 2 letter code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISO_3166_HOST

public static final String ISO_3166_HOST
See Also:
Constant Field Values

ISO_3166_TXT_FILE_PATH

public static final String ISO_3166_TXT_FILE_PATH
See Also:
Constant Field Values

DELIMITER

public static final String DELIMITER
See Also:
Constant Field Values

HTTP_PORT

public static final int HTTP_PORT
See Also:
Constant Field Values
Constructor Detail

CountryIsoCodeReader

public CountryIsoCodeReader()
Method Detail

retrieveCountries

public List retrieveCountries()
                       throws IOException
Returns a hashmap of the country names, keyed by their corresponding 2 letter code.

Throws:
IOException

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException