GeoPkgDataStoreFactory extends JDBCDataStoreFactory { public void setBaseDirectory(File baseDirectory) { this.baseDirectory = baseDirectory; } GeoPkgDataStoreFactory();  GeoPkgDataStoreFactory(GeoPkgGeomWriter.Configuration writerConfig); void setBaseDirectory(File baseDirectory); @Override String getDescription(); @Override BasicDataSource createDataSource(Map params); static final Param DBTYPE; static final Param USER; }
@Test public void testBaseDirectory() throws IOException { Map<String,Serializable> map = new HashMap<>(); map.put(GeoPkgDataStoreFactory.DBTYPE.key, "geopkg"); map.put(GeoPkgDataStoreFactory.DATABASE.key, "foo.gpkg"); GeoPkgDataStoreFactory factory = new GeoPkgDataStoreFactory(); factory.setBaseDirectory(tmp.getRoot()); SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); b.setName("foo"); b.setNamespaceURI("http: b.setSRS("EPSG:4326"); b.add("geom", Point.class); b.add("name", String.class); DataStore data = factory.createDataStore(map); data.createSchema(b.buildFeatureType()); data.dispose(); assertTrue(new File(tmp.getRoot(), "foo.gpkg").exists()); }