Skip to contents

File is a base R6 class representing a TSV/CSV/JSON output from a UMCCR workflow.

A File has a path, a basename, a type, and can be a presigned URL.

Public fields

path

Name or full path of the file.

is_url

Is the file a presigned URL?

Methods


Method new()

Create a new File object.

Usage

File$new(path = NULL, is_url = NULL)

Arguments

path

Name or full path of the file.

is_url

Is the file a presigned URL?


Method bname()

Basename of the file.

Usage

File$bname()

Returns

Basename of the file as a character vector.


Method type()

Get the type of file.

Usage

File$type()

Returns

String describing the specific type of dracarys file (NA if not a dracarys-recognised file).


Method print()

Print details about the File.

Usage

File$print(...)

Arguments

...

(ignored).


Method clone()

The objects of this class are cloneable with this method.

Usage

File$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

F1 <- File$new(readr::readr_example("mtcars.csv"))
(bname_f1 <- F1$bname())
#> [1] "mtcars.csv"
(F2 <- File$new("https://stratus-gds-aps2/foo/bar/baz.csv?bla"))
#> #--- File ---#
#> Path: https://stratus-gds-aps2/foo/bar/baz.csv?bla 
#> Basename: baz.csv 
#> Type: NA 
#> isURL: TRUE