public void create ( GeoPackageMetadata metadata ) { ContentValues values = new ContentValues ( ) ; values . put ( GeoPackageMetadata . COLUMN_NAME , metadata . getName ( ) ) ; values . put ( GeoPackageMetadata . COLUMN_EXTERNAL_PATH , metadata . getExternalPath ( ) ) ; long insertId = db . insert ( GeoPackageMetadata . TABLE_NAME , null , values ) ; if ( insertId == - 1 ) { throw new GeoPackageException ( "Failed to insert GeoPackage metadata. Name: " + metadata . getName ( ) + ", External Path: " + metadata . getExternalPath ( ) ) ; } metadata . setId ( insertId ) ; }
Create a new GeoPackage metadata