Implement copy method, update move method and remove trailing
[arvados.git] / sdk / R / man / ArvadosFile.Rd
index f48a71f515c6cf9ee01c4d1805b39ce78bf757b7..514e9e846df958548bacefa670b35e69814d0767 100644 (file)
@@ -1,14 +1,58 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/ArvadosFile.R
-\docType{data}
 \name{ArvadosFile}
 \alias{ArvadosFile}
-\title{ArvadosFile Object}
-\format{An object of class \code{R6ClassGenerator} of length 24.}
-\usage{
-ArvadosFile
-}
+\title{ArvadosFile}
 \description{
-Update description
+ArvadosFile class represents a file inside Arvados collection.
+}
+\section{Usage}{
+
+\preformatted{file = ArvadosFile$new(name)}
+}
+
+\section{Arguments}{
+
+\describe{
+  \item{name}{Name of the file.}
+}
+}
+
+\section{Methods}{
+
+\describe{
+  \item{getName()}{Returns name of the file.}
+  \item{getRelativePath()}{Returns file path relative to the root.}
+  \item{read(contentType = "raw", offset = 0, length = 0)}{Read file content.}
+  \item{write(content, contentType = "text/html")}{Write to file (override current content of the file).}
+  \item{connection(rw)}{Get connection opened in "read" or "write" mode.}
+  \item{flush()}{Write connections content to a file (override current content of the file).}
+  \item{remove(name)}{Removes ArvadosFile or Subcollection specified by name from the subcollection.}
+  \item{getSizeInBytes()}{Returns file size in bytes.}
+  \item{move(destination)}{Moves file to a new location inside collection.}
+  \item{copy(destination)}{Copies file to a new location inside collection.}
+}
+}
+
+\examples{
+\dontrun{
+myFile <- ArvadosFile$new("myFile")
+
+myFile$write("This is new file content")
+fileContent <- myFile$read()
+fileContent <- myFile$read("text")
+fileContent <- myFile$read("raw", offset = 8, length = 4)
+
+#Write a table:
+arvConnection <- myFile$connection("w")
+write.table(mytable, arvConnection)
+arvadosFile$flush()
+
+#Read a table:
+arvConnection <- myFile$connection("r")
+mytable <- read.table(arvConnection)
+
+myFile$move("newFolder/myFile")
+myFile$copy("newFolder/myFile")
+}
 }
-\keyword{datasets}