#' @param name Name of the new enviroment.
#' @return A new `ArvadosFile` object.
#' @examples
+ #' \dontrun{
#' myFile <- ArvadosFile$new("myFile")
+ #' }
initialize = function(name)
{
if(name == "")
#' @description
#' Returns name of the file.
#' @examples
+ #' \dontrun{
#' arvadosFile$getName()
+ #' }
getName = function() private$name,
#' @description
#' Returns collections file content as character vector.
#' @param fullPath Checking if TRUE.
#' @examples
+ #' \dontrun{
#' arvadosFile$getFileListing()
+ #' }
getFileListing = function(fullpath = TRUE)
{
self$getName()
#' @description
#' Returns collections content size in bytes.
#' @examples
+ #' \dontrun{
#' arvadosFile$getSizeInBytes()
+ #' }
getSizeInBytes = function()
{
if(is.null(private$collection))
#' @param offset Describes the location of a piece of data compared to another location
#' @param length Length of content
#' @examples
+ #' \dontrun{
#' collection <- Collection$new(arv, collectionUUID)
#' arvadosFile <- collection$get(fileName)
#' fileContent <- arvadosFile$read("text")
+ #' }
read = function(contentType = "raw", offset = 0, length = 0)
{
if(is.null(private$collection))
#' Get connection opened in "read" or "write" mode.
#' @param rw Type of connection.
#' @examples
+ #' \dontrun{
#' collection <- Collection$new(arv, collectionUUID)
#' arvadosFile <- collection$get(fileName)
#' arvConnection <- arvadosFile$connection("w")
+ #' }
connection = function(rw)
{
if (rw == "r" || rw == "rb")
#' @description
#' Write connections content to a file or override current content of the file.
#' @examples
+ #' \dontrun{
#' collection <- Collection$new(arv, collectionUUID)
#' arvadosFile <- collection$get(fileName)
#' myFile$write("This is new file content")
#' arvadosFile$flush()
+ #' }
flush = function()
{
v <- textConnectionValue(private$buffer)
#' @param content File to write.
#' @param contentType Type of content. Possible is "text", "raw".
#' @examples
+ #' \dontrun{
#' collection <- Collection$new(arv, collectionUUID)
#' arvadosFile <- collection$get(fileName)
#' myFile$write("This is new file content")
+ #' }
write = function(content, contentType = "text/html")
{
if(is.null(private$collection))
#' Moves file to a new location inside collection.
#' @param destination Path to new folder.
#' @examples
+ #' \dontrun{
#' arvadosFile$move(newPath)
+ #' }
move = function(destination)
{
if(is.null(private$collection))
#' Copies file to a new location inside collection.
#' @param destination Path to new folder.
#' @examples
+ #' \dontrun{
#' arvadosFile$copy("NewName.format")
+ #' }
copy = function(destination)
{
if(is.null(private$collection))