Improve Collections create and move methods and update documentation
[arvados.git] / sdk / R / man / Collection.Rd
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/Collection.R
3 \name{Collection}
4 \alias{Collection}
5 \title{Collection}
6 \description{
7 Collection class provides interface for working with Arvados collections.
8 }
9 \section{Usage}{
10
11 \preformatted{collection = Collection$new(arv, uuid)}
12 }
13
14 \section{Arguments}{
15
16 \describe{
17   \item{arv}{Arvados object.}
18   \item{uuid}{UUID of a collection.}
19 }
20 }
21
22 \section{Methods}{
23
24 \describe{
25   \item{add(content)}{Adds ArvadosFile or Subcollection specified by content to the collection.}
26   \item{create(files)}{Creates one or more ArvadosFiles and adds them to the collection at specified path.}
27   \item{remove(fileNames)}{Remove one or more files from the collection.}
28   \item{move(content, destination)}{Moves ArvadosFile or Subcollection to another location in the collection.}
29   \item{copy(content, destination)}{Copies ArvadosFile or Subcollection to another location in the collection.}
30   \item{getFileListing()}{Returns collections file content as character vector.}
31   \item{get(relativePath)}{If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.}
32 }
33 }
34
35 \examples{
36 \dontrun{
37 arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
38 collection <- Collection$new(arv, "uuid")
39
40 createdFiles <- collection$create(c("main.cpp", lib.dll), "cpp/src/")
41
42 collection$remove("location/to/my/file.cpp")
43
44 collection$move("folder/file.cpp", "file.cpp")
45
46 arvadosFile <- collection$get("location/to/my/file.cpp")
47 arvadosSubcollection <- collection$get("location/to/my/directory/")
48 }
49 }