Class DatabaseFolderImporter

    • Constructor Detail

      • DatabaseFolderImporter

        public DatabaseFolderImporter()
    • Method Detail

      • importFolder

        public abstract WritableDatabaseService importFolder​(java.io.File folder,
                                                             WritableDatabaseService destination,
                                                             Options options,
                                                             jebl.util.ProgressListener progress)
                                                      throws DocumentImportException,
                                                             java.io.IOException
        Import the external database to a Geneious WritableDatabaseService and report back the containing the added documents. The return value should normally be a newly-added folder.
        Parameters:
        folder - The folder containing the external database in the file system
        destination - parent folder where the folder will be imported
        Returns:
        Geneious service containing the documents added to the Geneious database
        Throws:
        DocumentImportException
        java.io.IOException
        Since:
        API 4.201920 (Geneious Prime 2019.2.0)
      • tentativeAutoDetect

        public abstract DocumentFileImporter.AutoDetectStatus tentativeAutoDetect​(java.io.File folder)
        Attempts to detect whether a folder has the right structure for this importer. This method should return quickly, and in particular it shouldn't normally attempt to parse any files in the folder. The folder parameter is provided to make it possible to quickly examine the directory structure to determine whether it appears to be correct. Parsing a small file to determine e.g., version compatibility, is permissible. Because this method shouldn't normally parse any files, it is also permissible in rare cases to return ACCEPT here even if the import will fail later on. However this method should never return REJECT if there is a chance that the file might be valid. This method also should not default to MAYBE in all cases where it cannot rightly return ACCEPT. It would then become the default importer for all folders it would be the only MAYBE returned for those files.
        Returns:
        Since:
        API 4.201920 (Geneious Prime 2019.2.0)
      • getUniqueId

        public java.lang.String getUniqueId()
        Get a unique identifier for this DocumentFileImporter. This is so that PluginUtilities.getDatabaseFolderImporter(String) can be used to find this DocumentFileImporter. A unique identifier may consist of any valid Java indentifier characters (see Character.isJavaIdentifierPart(char) as well as to the space character.
        Returns:
        a unique identifier for this DocumentFileImporter. The default implementation returns the className.
        Since:
        API 4.201920 (Geneious Prime 2019.2.0)
      • getDatabaseTypeDescription

        public abstract java.lang.String getDatabaseTypeDescription()
        Returns:
        The database type description. E.g.: "Some Application database"
        Since:
        API 4.201920 (Geneious Prime 2019.2.0)