Class TaxonomyDownloader

java.lang.Object
org.genesys.taxonomy.download.TaxonomyDownloader

public class TaxonomyDownloader extends Object
Download and extract GRIN-Taxa CAB files
  • Field Details

    • DEFAULT_GRIN_TAXA_CAB_URL

      public static final String DEFAULT_GRIN_TAXA_CAB_URL
      Location of the latest GRIN Taxonomy database published by NPGS
      See Also:
  • Constructor Details

    • TaxonomyDownloader

      public TaxonomyDownloader()
      Initialize the HTTP httpClientBuilder
  • Method Details

    • main

      public static void main(String[] args)
      Download GRIN Taxonomy database
      Parameters:
      args - program arguments
    • setHttpProxy

      public void setHttpProxy(String proxyHost)
      Set HTTP Proxy host
      Parameters:
      proxyHost - host address and port
    • downloadCurrent

      public void downloadCurrent(File outputFile) throws IOException
      Download current GRIN Taxonomy .cab file to outputFile.
      Parameters:
      outputFile - target file
      Throws:
      IOException - if the database cannot be downloaded
    • unpackCabinetFile

      public static void unpackCabinetFile(File downloadedCabFile, File destinationDir, boolean allowOverwrite) throws IOException
      Unpack .cab file to destination folder.
      Parameters:
      downloadedCabFile - .cab file
      destinationDir - target folder
      allowOverwrite - true if files can be overwritten
      Throws:
      IOException - when things go wrong