@@ -0,0 +1,1039 @@
+package ws.gazebo.util.ontTool.shp;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.io.Serializable;%0Aimport java.net.MalformedURLException;%0Aimport java.util.Collections;%0Aimport java.util.Map;%0A%0Aimport org.geotools.data.DataStore;%0Aimport org.geotools.data.FileDataStoreFactorySpi;%0Aimport org.geotools.data.FileDataStoreFinder;%0A%0Apublic class OntToolShp %7B%0A%0A%09public static FileDataStoreFactorySpi SHP_FACTORY = FileDataStoreFinder.getDataStoreFactory(%22shp%22);%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%0A%09%7D%0A%09%0A%09public static DataStore openShpDataStore(File f) %7B%0A%09%09Map%3CString, Serializable%3E m = null;%0A%09%09try %7B%0A%09%09%09m = Collections.singletonMap(%22url%22, (Serializable) f.toURI().toURL());%0A%09%09%7D catch (MalformedURLException e) %7B%0A%09%09%09// TODO Auto-generated catch block (should not be reached)%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%09DataStore ds = null;%0A%09%09try %7B%0A%09%09%09ds = SHP_FACTORY.createDataStore(m);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%09return ds;%0A%09%7D%0A%0A%7D%0A

add OntToolShp, defining method #openShpDataStore(File)