Added documentation to each public class of SDK.
[arvados.git] / sdk / R / man / ArvadosFile.Rd
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/ArvadosFile.R
3 \name{ArvadosFile}
4 \alias{ArvadosFile}
5 \title{ArvadosFile}
6 \description{
7 ArvadosFile class represents a file inside Arvados collection.
8 }
9 \section{Usage}{
10
11 \preformatted{file = ArvadosFile$new(name)}
12 }
13
14 \section{Arguments}{
15
16 \describe{
17   \item{name}{Name of the file.}
18 }
19 }
20
21 \section{Methods}{
22
23 \describe{
24   \item{getName()}{Returns name of the file}
25   \item{getRelativePath()}{Returns file path relative to the root.}
26   \item{read(contentType = "raw", offset = 0, length = 0)}{Read file content.}
27   \item{write(content, contentType = "text/html")}{Write to file (override current content of the file).}
28   \item{connection(rw)}{Get connection opened in "read" or "write" mode.}
29   \item{flush()}{Write content of the connecitons buffer to a file (override current content of the file).}
30   \item{remove(name)}{Removes ArvadosFile or Subcollection specified by name from the subcollection.}
31   \item{getSizeInBytes()}{Returns file size in bytes.}
32   \item{move(newLocation)}{Moves file to a new location inside collection.}
33 }
34 }
35
36 \examples{
37 \dontrun{
38 myFile <- ArvadosFile$new("myFile")
39
40 myFile$write("This is new file content")
41 fileContent <- myFile$read()
42 fileContent <- myFile$read("text")
43 fileContent <- myFile$read("raw", offset = 1024, length = 512)
44
45
46 #Write a table:
47 arvConnection <- myFile$connection("w")
48 write.table(mytable, arvConnection)
49 arvadosFile$flush()
50
51 #Read a table:
52 arvConnection <- myFile$connection("r")
53 mytable <- read.table(arvConnection)
54
55 myFile$move("newFolder/myFile")
56 }
57 }