From 4a2d7d5252db70766c109172e5c166fbca6089c9 Mon Sep 17 00:00:00 2001 From: Phill Date: Wed, 27 Jan 2016 22:17:55 +0000 Subject: [PATCH] Fix empty optional params for b2ListFileNames & b2ListFileVersions --- R/b2ListFileNames.R | 2 ++ R/b2ListFileVersions.R | 2 ++ R/b2UploadFile.R | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/R/b2ListFileNames.R b/R/b2ListFileNames.R index 15fb61b..33a4935 100644 --- a/R/b2ListFileNames.R +++ b/R/b2ListFileNames.R @@ -55,6 +55,8 @@ b2ListFileNames <- # Bind function option data frames together vars <- cbind(bucketId, startFileName, maxFileCount) + # Remove empty values + vars <- vars[, colSums(vars != "") != 0] # API call b2Return <- diff --git a/R/b2ListFileVersions.R b/R/b2ListFileVersions.R index ccaeebc..6b07a00 100644 --- a/R/b2ListFileVersions.R +++ b/R/b2ListFileVersions.R @@ -66,6 +66,8 @@ b2ListFileVersions <- # Bind function option data frames together vars <- cbind(bucketId, startFileName, startFileId, maxFileCount) + # Remove empty values + vars <- vars[, colSums(vars != "") != 0] # API call b2Return <- diff --git a/R/b2UploadFile.R b/R/b2UploadFile.R index df8bc65..25418c1 100644 --- a/R/b2UploadFile.R +++ b/R/b2UploadFile.R @@ -53,8 +53,8 @@ b2UploadFile <- function(authToken, uploadUrl, fileName) { # Get file extension fileNameExtension <- tools::file_ext(fileName) # File Types List - b2FileTypes <- system.file("extdata", "b2FileTypes.rds", package = "backblazer") - b2FileTypes <- readRDS(b2FileTypes) + b2FileTypesLocation <- system.file("extdata", "b2FileTypes.rds", package = "backblazer") + b2FileTypes <- readRDS(b2FileTypesLocation) b2ContentType <- b2FileTypes$contentType[grepl(fileNameExtension, b2FileTypes$fileExtension) == TRUE]