{
fileURL <- paste0(self$getWebDavHostName(), "c=",
uuid, "/", relativePath);
- headers <- list(Authorization = paste("OAuth2", self$token))
+ headers <- list(Authorization = paste("OAuth2", self$token))
serverResponse <- self$http$exec("DELETE", fileURL, headers,
retryTimes = self$numRetries)
{
collectionURL <- paste0(self$getWebDavHostName(), "c=", uuid, "/")
fromURL <- paste0(collectionURL, from)
- toURL <- paste0(collectionURL, to)
+ toURL <- paste0(collectionURL, trimFromStart(to, "/"))
headers <- list("Authorization" = paste("OAuth2", self$token),
- "Destination" = toURL)
+ "Destination" = toURL)
serverResponse <- self$http$exec("MOVE", fromURL, headers,
retryTimes = self$numRetries)
serverResponse
},
+ copy = function(from, to, uuid)
+ {
+ collectionURL <- paste0(self$getWebDavHostName(), "c=", uuid, "/")
+ fromURL <- paste0(collectionURL, from)
+ toURL <- paste0(collectionURL, trimFromStart(to, "/"))
+
+ headers <- list("Authorization" = paste("OAuth2", self$token),
+ "Destination" = toURL)
+
+ serverResponse <- self$http$exec("COPY", fromURL, headers,
+ retryTimes = self$numRetries)
+
+ if(serverResponse$status_code < 200 || serverResponse$status_code >= 300)
+ stop(paste("Server code:", serverResponse$status_code))
+
+ serverResponse
+ },
+
getCollectionContent = function(uuid)
{
collectionURL <- URLencode(paste0(self$getWebDavHostName(),
self$httpParser$parseResponse(serverResponse, "text")
},
- getConnection = function(uuid, relativePath, openMode)
+ getConnection = function(relativePath, uuid, openMode)
{
- fileURL <- paste0(self$getWebDavHostName(),
+ fileURL <- paste0(self$getWebDavHostName(),
"c=", uuid, "/", relativePath);
headers <- list(Authorization = paste("OAuth2", self$token))
- h <- curl::new_handle()
- curl::handle_setheaders(h, .list = headers)
-
- if(toString(Sys.getenv("ARVADOS_API_HOST_INSECURE") == "TRUE"))
- curl::handle_setopt(h, ssl_verifypeer = 0L)
-
- conn <- curl::curl(url = fileURL, open = openMode, handle = h)
-
- conn
+ conn <- self$http$getConnection(fileURL, headers, openMode)
}
),
{
fileURL <- paste0(self$getWebDavHostName(), "c=",
uuid, "/", relativePath)
- headers <- list(Authorization = paste("OAuth2", self$token),
+ headers <- list(Authorization = paste("OAuth2", self$token),
"Content-Type" = contentType)
body <- NULL