geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java
@Override
    public boolean createFile(String database, File file) {

        boolean created = false;

        if (exists(database)) {
            throw new GeoPackageException("GeoPackage already exists: "
                    + database);
        } else {

            // Check if the path is an absolute path to the GeoPackage file to create
            if (!GeoPackageValidate.hasGeoPackageExtension(file)) {

                // Make sure this isn't a path to another file extension
                if (GeoPackageIOUtils.getFileExtension(file) != null) {
                    throw new GeoPackageException("File can not have a non GeoPackage extension. Invalid File: "
                            + file.getAbsolutePath());
                }

                // Add the extension
                file = new File(file.getParentFile(), file.getName() + "." + GeoPackageConstants.GEOPACKAGE_EXTENSION);
            }

            // Make sure the file does not already exist
            if (file.exists()) {
                throw new GeoPackageException("GeoPackage file already exists: "
                        + file.getAbsolutePath());
            }

            // Create the new GeoPackage file
            GeoPackageDatabase db = new GeoPackageDatabase(SQLiteDatabase.openOrCreateDatabase(file, null));
            createAndCloseGeoPackage(db);

            // Import the GeoPackage
            created = importGeoPackageAsExternalLink(file, database);
        }
        return created;
    }
@Override
    public boolean createFile(String database, File file) {

        boolean created = false;

        if (exists(database)) {
            throw new GeoPackageException("GeoPackage already exists: "
                    + database);
        } else {

            // Check if the path is an absolute path to the GeoPackage file to create
            if (!GeoPackageValidate.hasGeoPackageExtension(file)) {

                // Make sure this isn't a path to another file extension
                if (GeoPackageIOUtils.getFileExtension(file) != null) {
                    throw new GeoPackageException("File can not have a non GeoPackage extension. Invalid File: "
                            + file.getAbsolutePath());
                }

                // Add the extension
                file = new File(file.getParentFile(), file.getName() + "." + GeoPackageConstants.GEOPACKAGE_EXTENSION);
            }

            // Make sure the file does not already exist
            if (file.exists()) {
                throw new GeoPackageException("GeoPackage file already exists: "
                        + file.getAbsolutePath());
            }

            // Create the new GeoPackage file
            GeoPackageDatabase db = new GeoPackageDatabase(SQLiteDatabase.openOrCreateDatabase(file, null));
            createAndCloseGeoPackage(db);

            // Import the GeoPackage
            created = importGeoPackageAsExternalLink(file, database);
        }
        return created;
    }
@ Override public boolean createFile ( String database , File file ) { boolean created = false ; if ( exists ( database ) ) { throw new GeoPackageException ( "GeoPackage already exists: " + database ) ; } else { // Check if the path is an absolute path to the GeoPackage file to create if ( ! GeoPackageValidate . hasGeoPackageExtension ( file ) ) { // Make sure this isn't a path to another file extension if ( GeoPackageIOUtils . getFileExtension ( file ) != null ) { throw new GeoPackageException ( "File can not have a non GeoPackage extension. Invalid File: " + file . getAbsolutePath ( ) ) ; } // Add the extension file = new File ( file . getParentFile ( ) , file . getName ( ) + "." + GeoPackageConstants . GEOPACKAGE_EXTENSION ) ; } // Make sure the file does not already exist if ( file . exists ( ) ) { throw new GeoPackageException ( "GeoPackage file already exists: " + file . getAbsolutePath ( ) ) ; } // Create the new GeoPackage file GeoPackageDatabase db = new GeoPackageDatabase ( SQLiteDatabase . openOrCreateDatabase ( file , null ) ) ; createAndCloseGeoPackage ( db ) ; // Import the GeoPackage created = importGeoPackageAsExternalLink ( file , database ) ; } return created ; }
{@inheritDoc}
{