19704: Merge contributed updates to R SDK
[arvados.git] / sdk / R / man / ArvadosFile.Rd
index 514e9e846df958548bacefa670b35e69814d0767..8275b7b6003fd1a540f9047f7f483d6f6267528d 100644 (file)
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/ArvadosFile.R
-\name{ArvadosFile}
-\alias{ArvadosFile}
-\title{ArvadosFile}
-\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")
-}
-}
+% Generated by roxygen2: do not edit by hand\r
+% Please edit documentation in R/ArvadosFile.R\r
+\name{ArvadosFile}\r
+\alias{ArvadosFile}\r
+\title{R6 Class Representing a ArvadosFile}\r
+\description{\r
+ArvadosFile class represents a file inside Arvados collection.\r
+}\r
+\examples{\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$new`\r
+## ------------------------------------------------\r
+\r
+myFile   <- ArvadosFile$new("myFile")\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$getName`\r
+## ------------------------------------------------\r
+\r
+arvadosFile$getName()\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$getFileListing`\r
+## ------------------------------------------------\r
+\r
+arvadosFile$getFileListing()\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$getSizeInBytes`\r
+## ------------------------------------------------\r
+\r
+arvadosFile$getSizeInBytes()\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$read`\r
+## ------------------------------------------------\r
+\r
+collection <- Collection$new(arv, collectionUUID)\r
+arvadosFile <- collection$get(fileName)\r
+fileContent <- arvadosFile$read("text")\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$connection`\r
+## ------------------------------------------------\r
+\r
+collection <- Collection$new(arv, collectionUUID)\r
+arvadosFile <- collection$get(fileName)\r
+arvConnection <- arvadosFile$connection("w")\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$flush`\r
+## ------------------------------------------------\r
+\r
+collection <- Collection$new(arv, collectionUUID)\r
+arvadosFile <- collection$get(fileName)\r
+myFile$write("This is new file content")\r
+arvadosFile$flush()\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$write`\r
+## ------------------------------------------------\r
+\r
+collection <- Collection$new(arv, collectionUUID)\r
+arvadosFile <- collection$get(fileName)\r
+myFile$write("This is new file content")\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$move`\r
+## ------------------------------------------------\r
+\r
+arvadosFile$move(newPath)\r
+\r
+## ------------------------------------------------\r
+## Method `ArvadosFile$copy`\r
+## ------------------------------------------------\r
+\r
+arvadosFile$copy("NewName.format")\r
+}\r
+\section{Methods}{\r
+\subsection{Public methods}{\r
+\itemize{\r
+\item \href{#method-new}{\code{ArvadosFile$new()}}\r
+\item \href{#method-getName}{\code{ArvadosFile$getName()}}\r
+\item \href{#method-getFileListing}{\code{ArvadosFile$getFileListing()}}\r
+\item \href{#method-getSizeInBytes}{\code{ArvadosFile$getSizeInBytes()}}\r
+\item \href{#method-get}{\code{ArvadosFile$get()}}\r
+\item \href{#method-getFirst}{\code{ArvadosFile$getFirst()}}\r
+\item \href{#method-getCollection}{\code{ArvadosFile$getCollection()}}\r
+\item \href{#method-setCollection}{\code{ArvadosFile$setCollection()}}\r
+\item \href{#method-getRelativePath}{\code{ArvadosFile$getRelativePath()}}\r
+\item \href{#method-getParent}{\code{ArvadosFile$getParent()}}\r
+\item \href{#method-setParent}{\code{ArvadosFile$setParent()}}\r
+\item \href{#method-read}{\code{ArvadosFile$read()}}\r
+\item \href{#method-connection}{\code{ArvadosFile$connection()}}\r
+\item \href{#method-flush}{\code{ArvadosFile$flush()}}\r
+\item \href{#method-write}{\code{ArvadosFile$write()}}\r
+\item \href{#method-move}{\code{ArvadosFile$move()}}\r
+\item \href{#method-copy}{\code{ArvadosFile$copy()}}\r
+\item \href{#method-duplicate}{\code{ArvadosFile$duplicate()}}\r
+}\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-new"></a>}}\r
+\if{latex}{\out{\hypertarget{method-new}{}}}\r
+\subsection{Method \code{new()}}{\r
+Initialize new enviroment.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$new(name)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{name}}{Name of the new enviroment.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Returns}{\r
+A new `ArvadosFile` object.\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{myFile   <- ArvadosFile$new("myFile")\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getName"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getName}{}}}\r
+\subsection{Method \code{getName()}}{\r
+Returns name of the file.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getName()}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{arvadosFile$getName()\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getFileListing"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getFileListing}{}}}\r
+\subsection{Method \code{getFileListing()}}{\r
+Returns collections file content as character vector.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getFileListing(fullpath = TRUE)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{fullPath}}{Checking if TRUE.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{arvadosFile$getFileListing()\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getSizeInBytes"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getSizeInBytes}{}}}\r
+\subsection{Method \code{getSizeInBytes()}}{\r
+Returns collections content size in bytes.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getSizeInBytes()}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{arvadosFile$getSizeInBytes()\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-get"></a>}}\r
+\if{latex}{\out{\hypertarget{method-get}{}}}\r
+\subsection{Method \code{get()}}{\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$get(fileLikeObjectName)}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getFirst"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getFirst}{}}}\r
+\subsection{Method \code{getFirst()}}{\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getFirst()}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getCollection"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getCollection}{}}}\r
+\subsection{Method \code{getCollection()}}{\r
+Returns collection UUID.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getCollection()}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-setCollection"></a>}}\r
+\if{latex}{\out{\hypertarget{method-setCollection}{}}}\r
+\subsection{Method \code{setCollection()}}{\r
+Sets new collection.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$setCollection(collection, setRecursively = TRUE)}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getRelativePath"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getRelativePath}{}}}\r
+\subsection{Method \code{getRelativePath()}}{\r
+Returns file path relative to the root.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getRelativePath()}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getParent"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getParent}{}}}\r
+\subsection{Method \code{getParent()}}{\r
+Returns project UUID.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getParent()}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-setParent"></a>}}\r
+\if{latex}{\out{\hypertarget{method-setParent}{}}}\r
+\subsection{Method \code{setParent()}}{\r
+Sets project collection.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$setParent(newParent)}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-read"></a>}}\r
+\if{latex}{\out{\hypertarget{method-read}{}}}\r
+\subsection{Method \code{read()}}{\r
+Read file content.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$read(contentType = "raw", offset = 0, length = 0)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{contentType}}{Type of content. Possible is "text", "raw".}\r
+\r
+\item{\code{offset}}{Describes the location of a piece of data compared to another location}\r
+\r
+\item{\code{length}}{Length of content}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection <- Collection$new(arv, collectionUUID)\r
+arvadosFile <- collection$get(fileName)\r
+fileContent <- arvadosFile$read("text")\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-connection"></a>}}\r
+\if{latex}{\out{\hypertarget{method-connection}{}}}\r
+\subsection{Method \code{connection()}}{\r
+Get connection opened in "read" or "write" mode.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$connection(rw)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{rw}}{Type of connection.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection <- Collection$new(arv, collectionUUID)\r
+arvadosFile <- collection$get(fileName)\r
+arvConnection <- arvadosFile$connection("w")\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-flush"></a>}}\r
+\if{latex}{\out{\hypertarget{method-flush}{}}}\r
+\subsection{Method \code{flush()}}{\r
+Write connections content to a file or override current content of the file.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$flush()}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection <- Collection$new(arv, collectionUUID)\r
+arvadosFile <- collection$get(fileName)\r
+myFile$write("This is new file content")\r
+arvadosFile$flush()\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-write"></a>}}\r
+\if{latex}{\out{\hypertarget{method-write}{}}}\r
+\subsection{Method \code{write()}}{\r
+Write to file or override current content of the file.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$write(content, contentType = "text/html")}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{content}}{File to write.}\r
+\r
+\item{\code{contentType}}{Type of content. Possible is "text", "raw".}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection <- Collection$new(arv, collectionUUID)\r
+arvadosFile <- collection$get(fileName)\r
+myFile$write("This is new file content")\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-move"></a>}}\r
+\if{latex}{\out{\hypertarget{method-move}{}}}\r
+\subsection{Method \code{move()}}{\r
+Moves file to a new location inside collection.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$move(destination)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{destination}}{Path to new folder.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{arvadosFile$move(newPath)\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-copy"></a>}}\r
+\if{latex}{\out{\hypertarget{method-copy}{}}}\r
+\subsection{Method \code{copy()}}{\r
+Copies file to a new location inside collection.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$copy(destination)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{destination}}{Path to new folder.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{arvadosFile$copy("NewName.format")\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-duplicate"></a>}}\r
+\if{latex}{\out{\hypertarget{method-duplicate}{}}}\r
+\subsection{Method \code{duplicate()}}{\r
+Duplicate file and gives it a new name.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$duplicate(newName = NULL)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{newName}}{New name for duplicated file.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+}\r
+}\r