initialize = function(name)
{
- private$name <- name
+ private$name <- name
},
getName = function() private$name,
getFileListing = function(fullPath = TRUE)
{
- content <- NULL
-
- if(fullPath)
- {
- for(child in private$children)
- content <- c(content, child$getFileListing())
+ content <- private$getContentAsCharVector(fullPath)
- if(private$name != "")
- content <- unlist(paste0(private$name, "/", content))
- }
- else
- {
- for(child in private$children)
- content <- c(content, child$getName())
- }
-
- content
+ content[order(tolower(content))]
},
getSizeInBytes = function()
parent$remove(private$name)
parent$setCollection(parentsCollection, setRecursively = FALSE)
+ },
+
+ getContentAsCharVector = function(fullPath = TRUE)
+ {
+ content <- NULL
+
+ if(fullPath)
+ {
+ for(child in private$children)
+ content <- c(content, child$getFileListing())
+
+ if(private$name != "")
+ content <- unlist(paste0(private$name, "/", content))
+ }
+ else
+ {
+ for(child in private$children)
+ content <- c(content, child$getName())
+ }
+
+ content
+
}
),
cloneable = FALSE
)
+
+#' @export print.Subcollection
+print.Subcollection = function(subCollection)
+{
+ collection <- NULL
+ relativePath <- subCollection$getRelativePath()
+
+ if(!is.null(subCollection$getCollection()))
+ {
+ collection <- subCollection$getCollection()$uuid
+
+ if(!subCollection$getName() == "")
+ relativePath <- paste0("/", relativePath)
+ }
+
+ cat(paste0("Type: ", "\"", "Arvados Subcollection", "\""), sep = "\n")
+ cat(paste0("Name: ", "\"", subCollection$getName(), "\""), sep = "\n")
+ cat(paste0("Relative path: ", "\"", relativePath, "\"") , sep = "\n")
+ cat(paste0("Collection: ", "\"", collection, "\""), sep = "\n")
+}