OPENNLP-750
Now the constructor of the AdminBoundaryContextGenerator will throw an IOException out to the GeoEntityLinker's init method if any of the following conditions are met:
the path to the file is empty or null
the file specified is not there
the file has no data in it resulting in an empty set of AdminBoundary data
This will force the EntityLinkerFactory to throw an ioexception when it calls the init method when instantiating the geoentitylinker

diff --git a/geoentitylinker-addon/src/main/java/opennlp/addons/geoentitylinker/AdminBoundaryContextGenerator.java b/geoentitylinker-addon/src/main/java/opennlp/addons/geoentitylinker/AdminBoundaryContextGenerator.java
index 5f1d149..c0d2645 100644
--- a/geoentitylinker-addon/src/main/java/opennlp/addons/geoentitylinker/AdminBoundaryContextGenerator.java
+++ b/geoentitylinker-addon/src/main/java/opennlp/addons/geoentitylinker/AdminBoundaryContextGenerator.java
@@ -81,14 +81,22 @@
     }

   }

 

-  public AdminBoundaryContextGenerator(EntityLinkerProperties properties) throws Exception {

+  public AdminBoundaryContextGenerator(EntityLinkerProperties properties) throws IOException{

     this.properties = properties;

     if (countrydata == null) {

       String path = this.properties.getProperty("opennlp.geoentitylinker.countrycontext.filepath", "");

-

+      if (path == null || path.trim().isEmpty()) {

+        throw new IOException("missing country context data configuration. Property opennlp.geoentitylinker.countrycontext.filepath must have a valid path value in entitylinker properties file");

+      }

       File countryContextFile = new File(path);

+      if (countryContextFile == null || !countryContextFile.exists()) {

+        throw new IOException("missing country context file");

+      }

       //countrydata = getCountryContextFromFile(countryContextFile);

       adminBoundaryData = getContextFromFile(countryContextFile);

+      if (adminBoundaryData.isEmpty()) {

+        throw new IOException("missing country context data");

+      }

     }

   }

 

@@ -140,7 +148,7 @@
    */

   private AdminBoundaryContext process(String text) {

     try {

-    

+

       reset();

       Map<String, Set<Integer>> countryhitMap = regexfind(text, countryMap, countryHitSet);

       if (!countryhitMap.isEmpty()) {