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)
String containing the project name.
String containing the asset name.
String containing a path to the registry.
String containing the URL to the Gobbler REST API. Only used for remote access.
Logical scalar indicating whether to force remote access via the API,
even if registry
is on the same filesystem as the caller.
String containing the latest version of the asset.
This may also be NULL
if the asset has no (non-probational) versions.
refreshLatest
, to refresh the latest version.
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"