ArvadosFileR Documentation

R6 Class Representing a ArvadosFile

Description

ArvadosFile class represents a file inside Arvados collection.

Methods

Public methods


Method new()

Initialize new enviroment.

Usage
ArvadosFile$new(name)
Arguments
name

Name of the new enviroment.

Returns

A new ArvadosFile object.

Examples
\dontrun{
myFile   <- ArvadosFile$new("myFile")
}

Method getName()

Returns name of the file.

Usage
ArvadosFile$getName()
Examples
\dontrun{
arvadosFile$getName()
}

Method getFileListing()

Returns collections file content as character vector.

Usage
ArvadosFile$getFileListing(fullpath = TRUE)
Arguments
fullPath

Checking if TRUE.

Examples
\dontrun{
arvadosFile$getFileListing()
}

Method getSizeInBytes()

Returns collections content size in bytes.

Usage
ArvadosFile$getSizeInBytes()
Examples
\dontrun{
arvadosFile$getSizeInBytes()
}

Method get()

Usage
ArvadosFile$get(fileLikeObjectName)

Method getFirst()

Usage
ArvadosFile$getFirst()

Method getCollection()

Returns collection UUID.

Usage
ArvadosFile$getCollection()

Method setCollection()

Sets new collection.

Usage
ArvadosFile$setCollection(collection, setRecursively = TRUE)

Method getRelativePath()

Returns file path relative to the root.

Usage
ArvadosFile$getRelativePath()

Method getParent()

Returns project UUID.

Usage
ArvadosFile$getParent()

Method setParent()

Sets project collection.

Usage
ArvadosFile$setParent(newParent)

Method read()

Read file content.

Usage
ArvadosFile$read(contentType = "raw", offset = 0, length = 0)
Arguments
contentType

Type of content. Possible is "text", "raw".

offset

Describes the location of a piece of data compared to another location

length

Length of content

Examples
\dontrun{
collection <- Collection$new(arv, collectionUUID)
arvadosFile <- collection$get(fileName)
fileContent <- arvadosFile$read("text")
}

Method connection()

Get connection opened in "read" or "write" mode.

Usage
ArvadosFile$connection(rw)
Arguments
rw

Type of connection.

Examples
\dontrun{
collection <- Collection$new(arv, collectionUUID)
arvadosFile <- collection$get(fileName)
arvConnection <- arvadosFile$connection("w")
}

Method flush()

Write connections content to a file or override current content of the file.

Usage
ArvadosFile$flush()
Examples
\dontrun{
collection <- Collection$new(arv, collectionUUID)
arvadosFile <- collection$get(fileName)
myFile$write("This is new file content")
arvadosFile$flush()
}

Method write()

Write to file or override current content of the file.

Usage
ArvadosFile$write(content, contentType = "text/html")
Arguments
content

File to write.

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")
}

Method move()

Moves file to a new location inside collection.

Usage
ArvadosFile$move(destination)
Arguments
destination

Path to new folder.

Examples
\dontrun{
arvadosFile$move(newPath)
}

Method copy()

Copies file to a new location inside collection.

Usage
ArvadosFile$copy(destination)
Arguments
destination

Path to new folder.

Examples
\dontrun{
arvadosFile$copy("NewName.format")
}

Method duplicate()

Duplicate file and gives it a new name.

Usage
ArvadosFile$duplicate(newName = NULL)
Arguments
newName

New name for duplicated file.

Examples


## ------------------------------------------------
## Method `ArvadosFile$new`
## ------------------------------------------------

## Not run: 
myFile   <- ArvadosFile$new("myFile")

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$getName`
## ------------------------------------------------

## Not run: 
arvadosFile$getName()

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$getFileListing`
## ------------------------------------------------

## Not run: 
arvadosFile$getFileListing()

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$getSizeInBytes`
## ------------------------------------------------

## Not run: 
arvadosFile$getSizeInBytes()

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$read`
## ------------------------------------------------

## Not run: 
collection <- Collection$new(arv, collectionUUID)
arvadosFile <- collection$get(fileName)
fileContent <- arvadosFile$read("text")

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$connection`
## ------------------------------------------------

## Not run: 
collection <- Collection$new(arv, collectionUUID)
arvadosFile <- collection$get(fileName)
arvConnection <- arvadosFile$connection("w")

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$flush`
## ------------------------------------------------

## Not run: 
collection <- Collection$new(arv, collectionUUID)
arvadosFile <- collection$get(fileName)
myFile$write("This is new file content")
arvadosFile$flush()

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$write`
## ------------------------------------------------

## Not run: 
collection <- Collection$new(arv, collectionUUID)
arvadosFile <- collection$get(fileName)
myFile$write("This is new file content")

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$move`
## ------------------------------------------------

## Not run: 
arvadosFile$move(newPath)

## End(Not run)

## ------------------------------------------------
## Method `ArvadosFile$copy`
## ------------------------------------------------

## Not run: 
arvadosFile$copy("NewName.format")

## End(Not run)