Class GeoPackageManagerImpl

java.lang.Object
mil.nga.geopackage.GeoPackageManagerImpl
All Implemented Interfaces:
GeoPackageManager
Direct Known Subclasses:
DGIWGGeoPackageManager

public class GeoPackageManagerImpl extends Object implements GeoPackageManager
GeoPackage Database management implementation
  • Constructor Details

    • GeoPackageManagerImpl

      protected GeoPackageManagerImpl(Context context)
      Constructor
      Parameters:
      context - context
  • Method Details

    • getContext

      public Context getContext()
      Get the application context
      Specified by:
      getContext in interface GeoPackageManager
      Returns:
      context
    • databases

      public List<String> databases()
      List all GeoPackage databases sorted alphabetically
      Specified by:
      databases in interface GeoPackageManager
      Returns:
      database list
    • databasesLike

      public List<String> databasesLike(String like)
      List GeoPackage databases that match the provided like argument
      Specified by:
      databasesLike in interface GeoPackageManager
      Parameters:
      like - like argument, using % as a wild card
      Returns:
      database names
    • databasesNotLike

      public List<String> databasesNotLike(String notLike)
      List GeoPackage databases that do not match the provided like argument
      Specified by:
      databasesNotLike in interface GeoPackageManager
      Parameters:
      notLike - not like argument, using % as a wild card
      Returns:
      database names
    • internalDatabases

      public List<String> internalDatabases()
      List all internal GeoPackage databases sorted alphabetically
      Specified by:
      internalDatabases in interface GeoPackageManager
      Returns:
      internal database list
    • externalDatabases

      public List<String> externalDatabases()
      List all external GeoPackage databases sorted alphabetically
      Specified by:
      externalDatabases in interface GeoPackageManager
      Returns:
      external database list
    • count

      public int count()
      Get the count of GeoPackage databases
      Specified by:
      count in interface GeoPackageManager
      Returns:
      count
    • internalCount

      public int internalCount()
      Get the count of internal GeoPackage databases
      Specified by:
      internalCount in interface GeoPackageManager
      Returns:
      internal count
    • externalCount

      public int externalCount()
      Get the count of external GeoPackage databases
      Specified by:
      externalCount in interface GeoPackageManager
      Returns:
      external count
    • databaseSet

      public Set<String> databaseSet()
      Set of all GeoPackage databases
      Specified by:
      databaseSet in interface GeoPackageManager
      Returns:
      database set
    • internalDatabaseSet

      public Set<String> internalDatabaseSet()
      Set of all internal GeoPackage databases
      Specified by:
      internalDatabaseSet in interface GeoPackageManager
      Returns:
      internal database set
    • externalDatabaseSet

      public Set<String> externalDatabaseSet()
      Set of all external GeoPackage databases
      Specified by:
      externalDatabaseSet in interface GeoPackageManager
      Returns:
      external database set
    • exists

      public boolean exists(String database)
      Determine if the database exists
      Specified by:
      exists in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      true if exists
    • size

      public long size(String database)
      Size of the database in bytes
      Specified by:
      size in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      bytes
    • isExternal

      public boolean isExternal(String database)
      Determine if the database is a linked external file
      Specified by:
      isExternal in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      external flag
    • existsAtExternalFile

      public boolean existsAtExternalFile(File file)
      Determine if a database exists at the provided external file
      Specified by:
      existsAtExternalFile in interface GeoPackageManager
      Parameters:
      file - database file
      Returns:
      true if exists
    • existsAtExternalPath

      public boolean existsAtExternalPath(String path)
      Determine if a database exists at the provided external file path
      Specified by:
      existsAtExternalPath in interface GeoPackageManager
      Parameters:
      path - database file path
      Returns:
      true if exists
    • existsAtExternalFile

      public boolean existsAtExternalFile(androidx.documentfile.provider.DocumentFile file)
      Determine if a database exists at the provided external document file
      Specified by:
      existsAtExternalFile in interface GeoPackageManager
      Parameters:
      file - document file
      Returns:
      true if exists
    • getPath

      public String getPath(String database)
      Get the path of the database
      Specified by:
      getPath in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      path
    • getFile

      public File getFile(String database)
      Get the file of the database
      Specified by:
      getFile in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      file
    • getDocumentFile

      public androidx.documentfile.provider.DocumentFile getDocumentFile(String database)
      Get the document file of the database
      Specified by:
      getDocumentFile in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      document file
    • getDatabaseAtExternalFile

      public String getDatabaseAtExternalFile(File file)
      Get the database name at the external file
      Specified by:
      getDatabaseAtExternalFile in interface GeoPackageManager
      Parameters:
      file - database file
      Returns:
      database name or null if does not exist
    • getDatabaseAtExternalPath

      public String getDatabaseAtExternalPath(String path)
      Get the database name at the external file path
      Specified by:
      getDatabaseAtExternalPath in interface GeoPackageManager
      Parameters:
      path - database file path
      Returns:
      database name or null if does not exist
    • getDatabaseAtExternalFile

      public String getDatabaseAtExternalFile(androidx.documentfile.provider.DocumentFile file)
      Get the database name at the external file
      Specified by:
      getDatabaseAtExternalFile in interface GeoPackageManager
      Parameters:
      file - database document file
      Returns:
      database name or null if does not exist
    • readableSize

      public String readableSize(String database)
      Get a readable version of the database size
      Specified by:
      readableSize in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      size
    • delete

      public boolean delete(String database)
      Delete a database
      Specified by:
      delete in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      true if deleted
    • deleteAll

      public boolean deleteAll()
      Delete all databases
      Specified by:
      deleteAll in interface GeoPackageManager
      Returns:
      true if deleted
    • deleteAllExternal

      public boolean deleteAllExternal()
      Delete all external GeoPackages
      Specified by:
      deleteAllExternal in interface GeoPackageManager
      Returns:
      true if deleted
    • deleteAllMissingExternal

      public boolean deleteAllMissingExternal()
      Delete all external GeoPackages where the external file can no longer be found
      Specified by:
      deleteAllMissingExternal in interface GeoPackageManager
      Returns:
      true if any were deleted
    • create

      public boolean create(String database)
      Create a new GeoPackage database
      Specified by:
      create in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      true if created
    • createAtPath

      public boolean createAtPath(String database, File path)
      Create a new GeoPackage database at the provided directory path
      Specified by:
      createAtPath in interface GeoPackageManager
      Parameters:
      database - database name
      path - directory path
      Returns:
      true if created
    • createFile

      public boolean createFile(File file)
      Create a new GeoPackage database at the specified file location
      Specified by:
      createFile in interface GeoPackageManager
      Parameters:
      file - GeoPackage file path
      Returns:
      true if created
    • createFile

      public boolean createFile(String database, File file)
      Create a new GeoPackage database at the specified file location with the provided name
      Specified by:
      createFile in interface GeoPackageManager
      Parameters:
      database - database name
      file - GeoPackage file path
      Returns:
      true if created
    • createFile

      public boolean createFile(androidx.documentfile.provider.DocumentFile file)
      Create a new GeoPackage database at the specified file location
      Specified by:
      createFile in interface GeoPackageManager
      Parameters:
      file - GeoPackage document file
      Returns:
      true if created
    • createFile

      public boolean createFile(String database, androidx.documentfile.provider.DocumentFile file)
      Create a new GeoPackage database at the specified file location with the provided name
      Specified by:
      createFile in interface GeoPackageManager
      Parameters:
      database - database name
      file - GeoPackage document file
      Returns:
      true if created
    • importGeoPackage

      public boolean importGeoPackage(File file)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      file - GeoPackage file to import
      Returns:
      true if loaded
    • importGeoPackage

      public boolean importGeoPackage(File file, GeoPackageProgress progress)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      file - GeoPackage file to import
      progress - progress tracker
      Returns:
      true if loaded
    • importGeoPackage

      public boolean importGeoPackage(File file, boolean override)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      file - GeoPackage file to import
      override - true to override existing
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(File file, boolean override, GeoPackageProgress progress)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      file - GeoPackage file to import
      override - true to override existing
      progress - progress tracker
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, File file)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - database name to save as
      file - GeoPackage file to import
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, File file, GeoPackageProgress progress)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - database name to save as
      file - GeoPackage file to import
      progress - progress tracker
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, File file, boolean override)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - database name to save the imported file as
      file - GeoPackage file to import
      override - true to override existing
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, File file, boolean override, GeoPackageProgress progress)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - database name to save the imported file as
      file - GeoPackage file to import
      override - true to override existing
      progress - progress tracker
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(androidx.documentfile.provider.DocumentFile file)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      file - GeoPackage document file to import
      Returns:
      true if loaded
    • importGeoPackage

      public boolean importGeoPackage(androidx.documentfile.provider.DocumentFile file, GeoPackageProgress progress)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      file - GeoPackage document file to import
      progress - progress tracker
      Returns:
      true if loaded
    • importGeoPackage

      public boolean importGeoPackage(androidx.documentfile.provider.DocumentFile file, boolean override)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      file - GeoPackage document file to import
      override - true to override existing
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(androidx.documentfile.provider.DocumentFile file, boolean override, GeoPackageProgress progress)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      file - GeoPackage document file to import
      override - true to override existing
      progress - progress tracker
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, androidx.documentfile.provider.DocumentFile file)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - database name to save as
      file - GeoPackage document file to import
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, androidx.documentfile.provider.DocumentFile file, GeoPackageProgress progress)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - database name to save as
      file - GeoPackage document file to import
      progress - progress tracker
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, androidx.documentfile.provider.DocumentFile file, boolean override)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - database name to save the imported file as
      file - GeoPackage document file to import
      override - true to override existing
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, androidx.documentfile.provider.DocumentFile file, boolean override, GeoPackageProgress progress)
      Import a GeoPackage file
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - database name to save the imported file as
      file - GeoPackage document file to import
      override - true to override existing
      progress - progress tracker
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String database, InputStream stream)
      Import a GeoPackage stream
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name to save as
      stream - GeoPackage stream to import
      Returns:
      true if loaded
    • importGeoPackage

      public boolean importGeoPackage(String database, InputStream stream, GeoPackageProgress progress)
      Import a GeoPackage stream
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name to save as
      stream - GeoPackage stream to import
      progress - progress tracker
      Returns:
      true if loaded
    • importGeoPackage

      public boolean importGeoPackage(String database, InputStream stream, boolean override)
      Import a GeoPackage stream
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name to save as
      stream - GeoPackage stream to import
      override - true to override existing
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String database, InputStream stream, boolean override, GeoPackageProgress progress)
      Import a GeoPackage stream
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name to save as
      stream - GeoPackage stream to import
      override - true to override existing
      progress - progress tracker
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, URL url)
      Import a GeoPackage file from a URL
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - GeoPackage name
      url - url
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, URL url, GeoPackageProgress progress)
      Import a GeoPackage file from a URL
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - GeoPackage name
      url - url
      progress - progress tracker
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, URL url, boolean override)
      Import a GeoPackage file from a URL
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - GeoPackage name
      url - url
      override - override flag
      Returns:
      true if created successfully
    • importGeoPackage

      public boolean importGeoPackage(String name, URL url, boolean override, GeoPackageProgress progress)
      Import a GeoPackage file from a URL
      Specified by:
      importGeoPackage in interface GeoPackageManager
      Parameters:
      name - GeoPackage name
      url - url
      override - override flag
      progress - progress tracker
      Returns:
      true if created successfully
    • exportGeoPackage

      public void exportGeoPackage(String database, File directory)
      Export a GeoPackage database to a file
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      directory - export directory
    • exportGeoPackage

      public void exportGeoPackage(String database, File directory, GeoPackageProgress progress)
      Export a GeoPackage database to a file
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      directory - export directory
      progress - progress tracker
    • exportGeoPackage

      public void exportGeoPackage(String database, String name, File directory)
      Export a GeoPackage database to a file
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      name - name
      directory - export directory
    • exportGeoPackage

      public void exportGeoPackage(String database, String name, File directory, GeoPackageProgress progress)
      Export a GeoPackage database to a file
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      name - name
      directory - export directory
      progress - progress tracker
    • exportGeoPackage

      public void exportGeoPackage(String database, androidx.documentfile.provider.DocumentFile file)
      Export a GeoPackage database to a document file
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      file - export document file
    • exportGeoPackage

      public void exportGeoPackage(String database, androidx.documentfile.provider.DocumentFile file, GeoPackageProgress progress)
      Export a GeoPackage database to a document file
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      file - export document file
      progress - progress tracker
    • exportGeoPackage

      public void exportGeoPackage(String database, String relativePath, Uri uri) throws IOException
      Export a GeoPackage database to a media store
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      relativePath - Relative path of this media item within the storage device where it is persisted
      uri - The URL of the table to insert into
      Throws:
      IOException - upon error
      See Also:
    • exportGeoPackage

      public void exportGeoPackage(String database, String relativePath, Uri uri, GeoPackageProgress progress) throws IOException
      Export a GeoPackage database to a media store
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      relativePath - Relative path of this media item within the storage device where it is persisted
      uri - The URL of the table to insert into
      progress - progress tracker
      Throws:
      IOException - upon error
      See Also:
    • exportGeoPackage

      public void exportGeoPackage(String database, String name, String relativePath, Uri uri) throws IOException
      Export a GeoPackage database to a media store
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      name - name
      relativePath - Relative path of this media item within the storage device where it is persisted
      uri - The URL of the table to insert into
      Throws:
      IOException - upon error
      See Also:
    • exportGeoPackage

      public void exportGeoPackage(String database, String name, String relativePath, Uri uri, GeoPackageProgress progress) throws IOException
      Export a GeoPackage database to a media store
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      name - name
      relativePath - Relative path of this media item within the storage device where it is persisted
      uri - The URL of the table to insert into
      progress - progress tracker
      Throws:
      IOException - upon error
      See Also:
    • exportGeoPackage

      public void exportGeoPackage(String database, Uri uri, ContentValues contentValues) throws IOException
      Export a GeoPackage database to a Uri
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      uri - The URL of the table to insert into
      contentValues - The initial values for the newly inserted row
      Throws:
      IOException - upon error
      See Also:
    • exportGeoPackage

      public void exportGeoPackage(String database, Uri uri, ContentValues contentValues, GeoPackageProgress progress) throws IOException
      Export a GeoPackage database to a Uri
      Specified by:
      exportGeoPackage in interface GeoPackageManager
      Parameters:
      database - database name
      uri - The URL of the table to insert into
      contentValues - The initial values for the newly inserted row
      progress - progress tracker
      Throws:
      IOException - upon error
      See Also:
    • open

      public GeoPackage open(String database)
      Open the database
      Specified by:
      open in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      open GeoPackage
    • open

      public GeoPackage open(String database, boolean writable)
      Open the database
      Specified by:
      open in interface GeoPackageManager
      Parameters:
      database - database name
      writable - true to open as writable, false as read only
      Returns:
      open GeoPackage
    • openExternal

      public GeoPackage openExternal(File path)
      Open an external GeoPackage
      Specified by:
      openExternal in interface GeoPackageManager
      Parameters:
      path - full file path
      Returns:
      open GeoPackage
    • openExternal

      public GeoPackage openExternal(File path, boolean writable)
      Open an external GeoPackage
      Specified by:
      openExternal in interface GeoPackageManager
      Parameters:
      path - full file path
      writable - true to open as writable, false as read only
      Returns:
      5.1.0
    • openExternal

      public GeoPackage openExternal(String path)
      Open an external GeoPackage
      Specified by:
      openExternal in interface GeoPackageManager
      Parameters:
      path - full file path
      Returns:
      open GeoPackage
    • openExternal

      public GeoPackage openExternal(String path, boolean writable)
      Open an external GeoPackage
      Specified by:
      openExternal in interface GeoPackageManager
      Parameters:
      path - full file path
      writable - true to open as writable, false as read only
      Returns:
      5.1.0
    • openExternal

      public GeoPackage openExternal(androidx.documentfile.provider.DocumentFile file)
      Open an external GeoPackage
      Specified by:
      openExternal in interface GeoPackageManager
      Parameters:
      file - document file
      Returns:
      open GeoPackage
    • openExternal

      public GeoPackage openExternal(androidx.documentfile.provider.DocumentFile file, boolean writable)
      Open an external GeoPackage
      Specified by:
      openExternal in interface GeoPackageManager
      Parameters:
      file - document file
      writable - true to open as writable, false as read only
      Returns:
      5.1.0
    • isImportHeaderValidation

      public boolean isImportHeaderValidation()
      Is import database header validation enabled. This causes a small time increase when importing a database to check the header bytes. On by default.
      Specified by:
      isImportHeaderValidation in interface GeoPackageManager
      Returns:
      true if enabled
    • setImportHeaderValidation

      public void setImportHeaderValidation(boolean enabled)
      Set the import database header validation setting. This causes a small time increase when importing a database to check the header bytes. On by default.
      Specified by:
      setImportHeaderValidation in interface GeoPackageManager
      Parameters:
      enabled - true to enable, false to disable
    • isImportIntegrityValidation

      public boolean isImportIntegrityValidation()
      Is import database integrity validation enabled. This causes a noticeable time increase when importing a database to check the database integrity. Off by default.
      Specified by:
      isImportIntegrityValidation in interface GeoPackageManager
      Returns:
      true if enabled
    • setImportIntegrityValidation

      public void setImportIntegrityValidation(boolean enabled)
      Set the import database integrity validation setting. This causes a noticeable time increase when importing a database to check the database integrity. Off by default.
      Specified by:
      setImportIntegrityValidation in interface GeoPackageManager
      Parameters:
      enabled - true to enable, false to disable
    • isOpenHeaderValidation

      public boolean isOpenHeaderValidation()
      Is open database header validation enabled. This causes a small time increase when opening a database to check the header bytes. Off by default.
      Specified by:
      isOpenHeaderValidation in interface GeoPackageManager
      Returns:
      true if enabled
    • setOpenHeaderValidation

      public void setOpenHeaderValidation(boolean enabled)
      Set the open database header validation setting. This causes a small time increase when opening a database to check the header bytes. Off by default.
      Specified by:
      setOpenHeaderValidation in interface GeoPackageManager
      Parameters:
      enabled - true to enable, false to disable
    • isOpenIntegrityValidation

      public boolean isOpenIntegrityValidation()
      Is open database integrity validation enabled. This causes a noticeable time increase when opening a database to check the database integrity. Off by default.
      Specified by:
      isOpenIntegrityValidation in interface GeoPackageManager
      Returns:
      true if enabled
    • setOpenIntegrityValidation

      public void setOpenIntegrityValidation(boolean enabled)
      Set the open database integrity validation setting. This causes a noticeable time increase when opening a database to check the database integrity. Off by default.
      Specified by:
      setOpenIntegrityValidation in interface GeoPackageManager
      Parameters:
      enabled - true to enable, false to disable
    • isSqliteWriteAheadLogging

      public boolean isSqliteWriteAheadLogging()
      Is the SQLite write ahead logging setting enabled for connections. Off by default.
      Specified by:
      isSqliteWriteAheadLogging in interface GeoPackageManager
      Returns:
      write ahead logging state
    • setSqliteWriteAheadLogging

      public void setSqliteWriteAheadLogging(boolean enabled)
      Set the SQLite write ahead logging setting for connections. Off by default.
      Specified by:
      setSqliteWriteAheadLogging in interface GeoPackageManager
      Parameters:
      enabled - true to enable, false to disable
    • getIgnoredInternals

      public Set<String> getIgnoredInternals()
      Get the ignored internal databases
      Specified by:
      getIgnoredInternals in interface GeoPackageManager
      Returns:
      databases
    • isIgnoredInternal

      public boolean isIgnoredInternal(String database)
      Is the database an ignored internal database by name
      Specified by:
      isIgnoredInternal in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      true if ignored
    • ignoreInternal

      public void ignoreInternal(String database)
      Ignore an internal database by name
      Specified by:
      ignoreInternal in interface GeoPackageManager
      Parameters:
      database - database name
    • includeInternal

      public void includeInternal(String database)
      Do not ignore an internal database by name
      Specified by:
      includeInternal in interface GeoPackageManager
      Parameters:
      database - database name
    • validate

      public boolean validate(String database)
      Validate the database header and integrity.
      Specified by:
      validate in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      true if valid, false if not
    • validateHeader

      public boolean validateHeader(String database)
      Validate the database header. Checks the beginning bytes for the SQLite header string.
      Specified by:
      validateHeader in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      true if valid, false if not
    • validateIntegrity

      public boolean validateIntegrity(String database)
      Validate the database integrity. Performs a database integrity ok check.
      Specified by:
      validateIntegrity in interface GeoPackageManager
      Parameters:
      database - database name
      Returns:
      true if valid, false if not
    • copy

      public boolean copy(String database, String databaseCopy)
      Copy the database
      Specified by:
      copy in interface GeoPackageManager
      Parameters:
      database - database name
      databaseCopy - database copy name
      Returns:
      true if copied
    • copy

      public boolean copy(String database, String databaseCopy, GeoPackageProgress progress)
      Copy the database
      Specified by:
      copy in interface GeoPackageManager
      Parameters:
      database - database name
      databaseCopy - database copy name
      progress - progress tracker
      Returns:
      true if copied
    • rename

      public boolean rename(String database, String newDatabase)
      Rename the database to the new name
      Specified by:
      rename in interface GeoPackageManager
      Parameters:
      database - database name
      newDatabase - new database name
      Returns:
      true if renamed
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(File path)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      path - full file path
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(File path, String database)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      path - full file path
      database - name to reference the database
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(File path, boolean override)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      path - full file path
      override - true to delete an existing database
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(File path, String database, boolean override)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      path - full file path
      database - name to reference the database
      override - true to delete an existing database
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(String path)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      path - full file path
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(String path, String database)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      path - full file path
      database - name to reference the database
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(String path, boolean override)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      path - full file path
      override - true to delete an existing database
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(String path, String database, boolean override)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      path - full file path
      database - name to reference the database
      override - true to delete an existing database
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(androidx.documentfile.provider.DocumentFile file)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      file - document file
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(androidx.documentfile.provider.DocumentFile file, boolean override)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      file - document file
      override - true to delete an existing database
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(androidx.documentfile.provider.DocumentFile file, String database)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      file - document file
      database - name to reference the database
      Returns:
      true if imported successfully
    • importGeoPackageAsExternalLink

      public boolean importGeoPackageAsExternalLink(androidx.documentfile.provider.DocumentFile file, String database, boolean override)
      Import an GeoPackage as an external file link without copying locally
      Specified by:
      importGeoPackageAsExternalLink in interface GeoPackageManager
      Parameters:
      file - document file
      database - name to reference the database
      override - true to delete an existing database
      Returns:
      true if imported successfully
    • getFile

      protected File getFile(androidx.documentfile.provider.DocumentFile file)
      Get a file from the document file
      Parameters:
      file - document file
      Returns:
      file
    • getDatabase

      protected String getDatabase(File file)
      Get the database name from the file
      Parameters:
      file - file
      Returns:
      database name