cloneProjectVersion.Rd
Clone the contents of a project version onto the local filesystem.
cloneProjectVersion(
dir,
url,
project,
version,
link.only = FALSE,
cache = NULL
)
String containing a path to the destination directory.
String containing the URL to the REST API.
String containing the project name.
String containing the project version.
Logical scalar indicating whether to create placeholder links instead of copies of the non-metadata files.
Caching function to use in getFile
or getFileMetadata
.
A directory is created at dir
with the contents of the specified project version.
NULL
is invisibly returned.
If link.only=TRUE
is specified, all non-metadata files are replaced by placeholder links using createPlaceholderLink
.
This avoids the download while retaining the project structure for further modifications, e.g., using initializeUpload
.
If cache
is provided, metadata documents are first cached and then copied to dir
.
This avoids re-downloads of the same documents in subsequent cloneProjectVersion
calls.
If link.only=FALSE
, non-metadata files will also be cached.
createPlaceholderLink
, for the link creation procedure.
tmp <- tempfile()
cloneProjectVersion(tmp, example.url, example.project, example.version)
list.files(tmp, recursive=TRUE)
#> [1] "blah.txt" "blah.txt.json" "foo/bar.txt" "foo/bar.txt.json"
#> [5] "whee.txt" "whee.txt.json"