FileResourceClient: File resource client

FileResourceClientR Documentation

File resource client

Description

File resource client

File resource client

Format

A R6 object of class FileResourceClient

Details

Base class that connects to a file using a FileResourceGetter.

Super class

resourcer::ResourceClient -> FileResourceClient

Methods

Public methods

Inherited methods

Method new()

Creates a new FileResourceClient instance.

Usage
FileResourceClient$new(resource, file.getter = NULL)
Arguments
resource

A valid resource object.

file.getter

A FileResourceGetter object, optional. If not provided, it will be looked up in the FileResourceGetters registry. The operation will fail if none can be found.

Returns

A FileResourceClient object.


Method downloadFile()

Performs the file download, if it does not already exists locally.

Usage
FileResourceClient$downloadFile()
Returns

The local path to the downloaded file.


Method close()

Removes the file if it was downloaded. A local file resource will remain untouched.

Usage
FileResourceClient$close()

Method clone()

The objects of this class are cloneable with this method.

Usage
FileResourceClient$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


obiba/resourcer documentation built on May 5, 2023, 10:08 a.m.