BiodbDownloadable-class {biodb}R Documentation

An abstract class (more like an interface) to model a remote database that can be downloaded locally.

Description

The class must be inherited by any remote database class that allows download of its whole content. The hidden/private method .doDownload() must be implemented by the database class.

Methods

download()

:

Downloads the database content locally.

Returned value: None.

getDownloadPath()

:

Gets the path where the downloaded content is written.

Returned value: The path where the downloaded database is written.

isDownloaded()

:

Tests if the database has been downloaded.

Returned value: TRUE if the database content has already been downloaded.

isExtracted()

:

Tests if the downloaded database has been extracted (in case the database needs extraction).

Returned value: TRUE if the downloaded database content has been extracted, FALSE otherwise.

See Also

BiodbRemotedbConn.

Examples

# Creating a connector class for a downloadable database:
FooDownloadableDb <- methods::setRefClass('FooDownloadableDb',
    contains=c('BiodbRemotedbConn', 'BiodbDownloadable'),

methods=list(

   # ... other methods ...

   # BiodbDownloadable methods
   .doDownload=function() {
       # Download the database
   },

   .doExtractDownload=function() {
       # Extract data from the downloaded file(s)
   }
))


[Package biodb version 1.0.4 Index]