Package org.genesys.taxonomy.download
Class TaxonomyDownloader
java.lang.Object
org.genesys.taxonomy.download.TaxonomyDownloader
Download and extract GRIN-Taxa CAB files
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringLocation of the latest GRIN Taxonomy database published by NPGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddownloadCurrent(File outputFile) Download current GRIN Taxonomy .cab file tooutputFile.static voidDownload GRIN Taxonomy databasevoidsetHttpProxy(String proxyHost) Set HTTP Proxy hoststatic voidunpackCabinetFile(File downloadedCabFile, File destinationDir, boolean allowOverwrite) Unpack .cab file to destination folder.
-
Field Details
-
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
Download GRIN Taxonomy database- Parameters:
args- program arguments
-
setHttpProxy
Set HTTP Proxy host- Parameters:
proxyHost- host address and port
-
downloadCurrent
Download current GRIN Taxonomy .cab file tooutputFile.- 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 filedestinationDir- target folderallowOverwrite-trueif files can be overwritten- Throws:
IOException- when things go wrong
-