3 HttpParser <- setRefClass(
11 initialize = function()
15 parseCollectionGet = function(server_response)
17 parsed_response <- httr::content(server_response, as = "parsed", type = "application/json")
19 #Todo(Fudo): Create new Collection object and populate it
22 parseWebDAVResponse = function(response, uri)
24 #Todo(Fudo): Move this to HttpParser.
25 text <- rawToChar(response$content)
26 doc <- XML::xmlParse(text, asText=TRUE)
28 # calculate relative paths
29 base <- paste(paste("/", strsplit(uri, "/")[[1]][-1:-3], sep="", collapse=""), "/", sep="")
31 XML::xpathApply(doc, "//D:response/D:href", function(node) {
32 sub(base, "", URLdecode(xmlValue(node)), fixed=TRUE)