private void verifyCreate ( Contents contents ) throws SQLException { ContentsDataType dataType = contents . getDataType ( ) ; if ( dataType != null ) { switch ( dataType ) { case FEATURES : // Features require Geometry Columns table (Spec Requirement 21) GeometryColumnsDao geometryColumnsDao = getGeometryColumnsDao ( ) ; if ( ! geometryColumnsDao . isTableExists ( ) ) { throw new GeoPackageException ( "A data type of " + dataType . getName ( ) + " requires the " + GeometryColumns . class . getSimpleName ( ) + " table to first be created using the GeoPackage." ) ; } break ; case TILES : verifyTiles ( dataType ) ; break ; case GRIDDED_COVERAGE : verifyTiles ( dataType ) ; break ; case ATTRIBUTES : break ; default : throw new GeoPackageException ( "Unsupported data type: " + dataType ) ; } } // Verify the feature or tile table exists if ( ! db . tableExists ( contents . getTableName ( ) ) ) { throw new GeoPackageException ( "No table exists for Content Table Name: " + contents . getTableName ( ) + ". Table must first be created." ) ; } }
Verify the tables are in the expected state for the Contents create