Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions R/item_file_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#' parameter is not specified.
#' @param overwrite_file Boolean indicating if file should be overwritten if it
#' already exists locally
#' @param fetch_cloud_urls (logical) fetch a tokenized cloud download URLs? Default: \code{TRUE}
#' This option will take slightly longer but the `url` attribute of the returned list will
#' work for direct file downloads or use with other applications and libraries.
#'
#' @return Character vector of full paths to local files
#'
Expand All @@ -30,14 +33,15 @@
#' @export
item_file_download = function(sb_id, ..., names, destinations,
dest_dir = getwd(),
overwrite_file = FALSE){
overwrite_file = FALSE,
fetch_cloud_urls = FALSE){

sb_id = as.sbitem(sb_id)

if(!session_validate())
stop('Session state is invalid, please re-authenticate')

flist <- item_list_files(sb_id, fetch_cloud_urls = FALSE, ...)
flist <- item_list_files(sb_id, fetch_cloud_urls = fetch_cloud_urls, ...)

if(nrow(flist) < 1)
stop(sb_id$id, ':Item has no attached files')
Expand Down
6 changes: 4 additions & 2 deletions R/item_list_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @param recursive (logical) List files recursively. Default: \code{FALSE}
#' @param fetch_cloud_urls (logical) fetch a tokenized cloud download URLs? Default: \code{TRUE}
#' This option will take slightly longer but the `url` attribute of the returned list will
#' work for direct file downloads or use with pther applications and libraries.
#' work for direct file downloads or use with other applications and libraries.
#'
#' @return
#' A data.frame with columns fname, size, url, and facet.
Expand Down Expand Up @@ -154,7 +154,9 @@ get_facet_files <- function(item) {
list(name = y$name,
size = y$size,
url = y$downloadUri,
facet_name = x$name)
facet_name = x$name,
cuid = y$cuid,
key = y$key)

}, n = x$name)

Expand Down
7 changes: 6 additions & 1 deletion man/item_file_download.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/item_list_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading