Moved all classes from RefClass OOP model to R6 and made improvements
[arvados.git] / sdk / R / R / HttpParser.R
index fb895bed34505989c4f444871739c45c431302ba..d54207ea6f4a4c6fa8ec18904084be7cdc235b20 100644 (file)
@@ -1,35 +1,24 @@
 #' HttpParser
 #'
-HttpParser <- setRefClass(
+HttpParser <- R6::R6Class(
 
     "HttrParser",
 
-    fields = list(
-    ),
-
-    methods = list(
+    public = list(
         initialize = function() 
         {
         },
 
-        parseCollectionGet = function(serverResponse) 
-        {
-            parsed_response <- httr::content(serverResponse, as = "parsed", type = "application/json")
-
-            #Todo(Fudo): Create new Collection object and populate it
-        },
-
         parseJSONResponse = function(serverResponse) 
         {
             parsed_response <- httr::content(serverResponse, as = "parsed", type = "application/json")
-
-            #Todo(Fudo): Create new Collection object and populate it
         },
 
+        #Todo(Fudo): Test this.
         parseWebDAVResponse = function(response, uri)
         {
-            #Todo(Fudo): Move this to HttpParser.
             text <- rawToChar(response$content)
+            print(text)
             doc <- XML::xmlParse(text, asText=TRUE)
 
             # calculate relative paths
@@ -40,9 +29,8 @@ HttpParser <- setRefClass(
                 })
             )
             result <- result[result != ""]
-            #Todo(Fudo): Test this.
+
             result[-1]
         }
-
     )
 )