use of eu.esdihumboldt.hale.io.jdbc.spatialite.reader.internal.SpatiaLiteInstanceReader in project hale by halestudio.
the class SpatiaLiteTestSuite method readInstances.
/**
* Reads instances from from a SpatiaLite database file with the provided
* schema.
*
* @param sourceSchema the schema of the source database
* @param sourceFilePath the path to the source database file
* @return the read instances
* @throws Exception any exception thrown by
* {@link SpatiaLiteInstanceReader}
*/
public InstanceCollection readInstances(Schema sourceSchema, String sourceFilePath) throws Exception {
SpatiaLiteInstanceReader instanceReader = new SpatiaLiteInstanceReader();
instanceReader.setSource(new FileIOSupplier(new File(sourceFilePath)));
instanceReader.setSourceSchema(sourceSchema);
// Test instances
IOReport report = instanceReader.execute(new LogProgressIndicator());
assertTrue("Data import was not successfull.", report.isSuccess());
return instanceReader.getInstances();
}
Aggregations