Fetch the latest version of a project's asset. This will call the REST API if the caller is not on the same filesystem as the registry.

fetchLatest(project, asset, registry, url, forceRemote = FALSE)

Arguments

project

String containing the project name.

asset

String containing the asset name.

registry

String containing a path to the registry.

url

String containing the URL to the Gobbler REST API. Only used for remote access.

forceRemote

Logical scalar indicating whether to force remote access via the API, even if registry is on the same filesystem as the caller.

Value

String containing the latest version of the asset. This may also be NULL if the asset has no (non-probational) versions.

See also

refreshLatest, to refresh the latest version.

Author

Aaron Lun

Examples

info <- startGobbler()
removeProject("test", info$staging, url=info$url) # start with a clean slate.
createProject("test", info$staging, url=info$url) 

# Mocking up a few uploads.
src <- allocateUploadDirectory(info$staging)
uploadDirectory("test", "simple", "v1", src, staging=info$staging, url=info$url)
uploadDirectory("test", "simple", "v2", src, staging=info$staging, url=info$url)

# Obtaining the latest version of this asset.
fetchLatest("test", "simple", registry=info$registry, url=info$url)
#> [1] "v2"

# Forcing remote access.
fetchLatest("test", "simple", registry=info$registry, url=info$url, forceRemote=TRUE)
#> [1] "v2"