/** * Read the GeoJSON file. * * @param progress * @param tableReference * @throws java.sql.SQLException * @throws java.io.IOException */ public void read(ProgressVisitor progress, String tableReference) throws SQLException, IOException { if (FileUtil.isFileImportable(fileName, "geojson")) { this.isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData()); this.tableLocation = TableLocation.parse(tableReference, isH2); if (fileName.length() > 0) { parseGeoJson(progress); } else { JDBCUtilities.createEmptyTable(connection, tableLocation.toString()); } } }
/** * Read the GeoJSON file. * * @param progress * @param tableReference * @throws java.sql.SQLException * @throws java.io.IOException */ public void read(ProgressVisitor progress, String tableReference) throws SQLException, IOException { if (FileUtil.isFileImportable(fileName, "geojson")) { this.isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData()); this.tableLocation = TableLocation.parse(tableReference, isH2); if (fileName.length() > 0) { parseGeoJson(progress); } else { JDBCUtilities.createEmptyTable(connection, tableLocation.toString()); } } }
/** * * @param connection Active connection, do not close this connection. * @param tableReference prefix uses to store the GPX tables * @param fileName File path to read * @param progress * @param deleteTables true to delete the existing tables * @throws SQLException Table write error * @throws IOException File read error */ public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress, boolean deleteTables) throws SQLException, IOException { boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData()); if (fileName.length() == 0) { JDBCUtilities.createEmptyTable(connection, TableLocation.parse(tableReference, isH2).toString()); } else { if (deleteTables) { GPXTablesFactory.dropOSMTables(connection, isH2, tableReference); } GpxParser gpd = new GpxParser(); gpd.read(fileName, tableReference, connection); } } }
/** * * @param connection Active connection, do not close this connection. * @param tableReference prefix uses to store the GPX tables * @param fileName File path to read * @param progress * @param deleteTables true to delete the existing tables * @throws SQLException Table write error * @throws IOException File read error */ @Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress, boolean deleteTables) throws SQLException, IOException { boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData()); if (fileName.length() == 0) { JDBCUtilities.createEmptyTable(connection, TableLocation.parse(tableReference, isH2).toString()); } else { if (deleteTables) { GPXTablesFactory.dropOSMTables(connection, isH2, tableReference); } GpxParser gpd = new GpxParser(); gpd.read(fileName, tableReference, connection); } } }
ProgressVisitor copyProgress = progress.subProcess((int) (dbfDriver.getRowCount() / BATCH_MAX_SIZE)); if (dbfHeader.getNumFields() == 0) { JDBCUtilities.createEmptyTable(connection, parsedTable); } else { try {
ProgressVisitor copyProgress = progress.subProcess((int) (dbfDriver.getRowCount() / BATCH_MAX_SIZE)); if (dbfHeader.getNumFields() == 0) { JDBCUtilities.createEmptyTable(connection, parsedTable); } else { try {