Skip to content

FileStorageReference

A reference to one file in the CAWS file storage of a study.

Obtained from CarpService.getFileStorageReference or CarpService.getFileStorageReferenceByName. Used to:

download, get and delete need a known id; upload sets it.

Inheritance

Properties

fileEndpointUri

String get fileEndpointUri

The URL for the file end point for this FileStorageReference.

id

int id
getter/setter pair

The CARP server-side ID of this file.

-1 if unknown or referencing a file not uploaded yet.

studyId

String get studyId

The id of the study this file belongs to.

Methods

delete

Future<void> delete()

Deletes the file at this FileStorageReference.

download

FileDownloadTask download(
  1. File file
)

Starts a download of this file into the local file and returns the running FileDownloadTask.

get

Gets the metadata of this file from CAWS.

upload

FileUploadTask upload(
  1. File file, [
  2. Map<String, String>? metadata
])

Starts an upload of file with optional metadata and returns the running FileUploadTask.

The file must exist. On success, id is set to the server-side ID.