1 % Generated by roxygen2: do not edit by hand
\r
2 % Please edit documentation in R/ArvadosFile.R
\r
5 \title{R6 Class Representing a ArvadosFile}
\r
7 ArvadosFile class represents a file inside Arvados collection.
\r
11 ## ------------------------------------------------
\r
12 ## Method `ArvadosFile$new`
\r
13 ## ------------------------------------------------
\r
15 myFile <- ArvadosFile$new("myFile")
\r
17 ## ------------------------------------------------
\r
18 ## Method `ArvadosFile$getName`
\r
19 ## ------------------------------------------------
\r
21 arvadosFile$getName()
\r
23 ## ------------------------------------------------
\r
24 ## Method `ArvadosFile$getFileListing`
\r
25 ## ------------------------------------------------
\r
27 arvadosFile$getFileListing()
\r
29 ## ------------------------------------------------
\r
30 ## Method `ArvadosFile$getSizeInBytes`
\r
31 ## ------------------------------------------------
\r
33 arvadosFile$getSizeInBytes()
\r
35 ## ------------------------------------------------
\r
36 ## Method `ArvadosFile$read`
\r
37 ## ------------------------------------------------
\r
39 collection <- Collection$new(arv, collectionUUID)
\r
40 arvadosFile <- collection$get(fileName)
\r
41 fileContent <- arvadosFile$read("text")
\r
43 ## ------------------------------------------------
\r
44 ## Method `ArvadosFile$connection`
\r
45 ## ------------------------------------------------
\r
47 collection <- Collection$new(arv, collectionUUID)
\r
48 arvadosFile <- collection$get(fileName)
\r
49 arvConnection <- arvadosFile$connection("w")
\r
51 ## ------------------------------------------------
\r
52 ## Method `ArvadosFile$flush`
\r
53 ## ------------------------------------------------
\r
55 collection <- Collection$new(arv, collectionUUID)
\r
56 arvadosFile <- collection$get(fileName)
\r
57 myFile$write("This is new file content")
\r
60 ## ------------------------------------------------
\r
61 ## Method `ArvadosFile$write`
\r
62 ## ------------------------------------------------
\r
64 collection <- Collection$new(arv, collectionUUID)
\r
65 arvadosFile <- collection$get(fileName)
\r
66 myFile$write("This is new file content")
\r
68 ## ------------------------------------------------
\r
69 ## Method `ArvadosFile$move`
\r
70 ## ------------------------------------------------
\r
72 arvadosFile$move(newPath)
\r
74 ## ------------------------------------------------
\r
75 ## Method `ArvadosFile$copy`
\r
76 ## ------------------------------------------------
\r
78 arvadosFile$copy("NewName.format")
\r
81 \subsection{Public methods}{
\r
83 \item \href{#method-new}{\code{ArvadosFile$new()}}
\r
84 \item \href{#method-getName}{\code{ArvadosFile$getName()}}
\r
85 \item \href{#method-getFileListing}{\code{ArvadosFile$getFileListing()}}
\r
86 \item \href{#method-getSizeInBytes}{\code{ArvadosFile$getSizeInBytes()}}
\r
87 \item \href{#method-get}{\code{ArvadosFile$get()}}
\r
88 \item \href{#method-getFirst}{\code{ArvadosFile$getFirst()}}
\r
89 \item \href{#method-getCollection}{\code{ArvadosFile$getCollection()}}
\r
90 \item \href{#method-setCollection}{\code{ArvadosFile$setCollection()}}
\r
91 \item \href{#method-getRelativePath}{\code{ArvadosFile$getRelativePath()}}
\r
92 \item \href{#method-getParent}{\code{ArvadosFile$getParent()}}
\r
93 \item \href{#method-setParent}{\code{ArvadosFile$setParent()}}
\r
94 \item \href{#method-read}{\code{ArvadosFile$read()}}
\r
95 \item \href{#method-connection}{\code{ArvadosFile$connection()}}
\r
96 \item \href{#method-flush}{\code{ArvadosFile$flush()}}
\r
97 \item \href{#method-write}{\code{ArvadosFile$write()}}
\r
98 \item \href{#method-move}{\code{ArvadosFile$move()}}
\r
99 \item \href{#method-copy}{\code{ArvadosFile$copy()}}
\r
100 \item \href{#method-duplicate}{\code{ArvadosFile$duplicate()}}
\r
103 \if{html}{\out{<hr>}}
\r
104 \if{html}{\out{<a id="method-new"></a>}}
\r
105 \if{latex}{\out{\hypertarget{method-new}{}}}
\r
106 \subsection{Method \code{new()}}{
\r
107 Initialize new enviroment.
\r
108 \subsection{Usage}{
\r
109 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$new(name)}\if{html}{\out{</div>}}
\r
112 \subsection{Arguments}{
\r
113 \if{html}{\out{<div class="arguments">}}
\r
115 \item{\code{name}}{Name of the new enviroment.}
\r
117 \if{html}{\out{</div>}}
\r
119 \subsection{Returns}{
\r
120 A new `ArvadosFile` object.
\r
122 \subsection{Examples}{
\r
123 \if{html}{\out{<div class="r example copy">}}
\r
124 \preformatted{myFile <- ArvadosFile$new("myFile")
\r
126 \if{html}{\out{</div>}}
\r
131 \if{html}{\out{<hr>}}
\r
132 \if{html}{\out{<a id="method-getName"></a>}}
\r
133 \if{latex}{\out{\hypertarget{method-getName}{}}}
\r
134 \subsection{Method \code{getName()}}{
\r
135 Returns name of the file.
\r
136 \subsection{Usage}{
\r
137 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getName()}\if{html}{\out{</div>}}
\r
140 \subsection{Examples}{
\r
141 \if{html}{\out{<div class="r example copy">}}
\r
142 \preformatted{arvadosFile$getName()
\r
144 \if{html}{\out{</div>}}
\r
149 \if{html}{\out{<hr>}}
\r
150 \if{html}{\out{<a id="method-getFileListing"></a>}}
\r
151 \if{latex}{\out{\hypertarget{method-getFileListing}{}}}
\r
152 \subsection{Method \code{getFileListing()}}{
\r
153 Returns collections file content as character vector.
\r
154 \subsection{Usage}{
\r
155 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getFileListing(fullpath = TRUE)}\if{html}{\out{</div>}}
\r
158 \subsection{Arguments}{
\r
159 \if{html}{\out{<div class="arguments">}}
\r
161 \item{\code{fullPath}}{Checking if TRUE.}
\r
163 \if{html}{\out{</div>}}
\r
165 \subsection{Examples}{
\r
166 \if{html}{\out{<div class="r example copy">}}
\r
167 \preformatted{arvadosFile$getFileListing()
\r
169 \if{html}{\out{</div>}}
\r
174 \if{html}{\out{<hr>}}
\r
175 \if{html}{\out{<a id="method-getSizeInBytes"></a>}}
\r
176 \if{latex}{\out{\hypertarget{method-getSizeInBytes}{}}}
\r
177 \subsection{Method \code{getSizeInBytes()}}{
\r
178 Returns collections content size in bytes.
\r
179 \subsection{Usage}{
\r
180 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getSizeInBytes()}\if{html}{\out{</div>}}
\r
183 \subsection{Examples}{
\r
184 \if{html}{\out{<div class="r example copy">}}
\r
185 \preformatted{arvadosFile$getSizeInBytes()
\r
187 \if{html}{\out{</div>}}
\r
192 \if{html}{\out{<hr>}}
\r
193 \if{html}{\out{<a id="method-get"></a>}}
\r
194 \if{latex}{\out{\hypertarget{method-get}{}}}
\r
195 \subsection{Method \code{get()}}{
\r
196 \subsection{Usage}{
\r
197 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$get(fileLikeObjectName)}\if{html}{\out{</div>}}
\r
201 \if{html}{\out{<hr>}}
\r
202 \if{html}{\out{<a id="method-getFirst"></a>}}
\r
203 \if{latex}{\out{\hypertarget{method-getFirst}{}}}
\r
204 \subsection{Method \code{getFirst()}}{
\r
205 \subsection{Usage}{
\r
206 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getFirst()}\if{html}{\out{</div>}}
\r
210 \if{html}{\out{<hr>}}
\r
211 \if{html}{\out{<a id="method-getCollection"></a>}}
\r
212 \if{latex}{\out{\hypertarget{method-getCollection}{}}}
\r
213 \subsection{Method \code{getCollection()}}{
\r
214 Returns collection UUID.
\r
215 \subsection{Usage}{
\r
216 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getCollection()}\if{html}{\out{</div>}}
\r
220 \if{html}{\out{<hr>}}
\r
221 \if{html}{\out{<a id="method-setCollection"></a>}}
\r
222 \if{latex}{\out{\hypertarget{method-setCollection}{}}}
\r
223 \subsection{Method \code{setCollection()}}{
\r
224 Sets new collection.
\r
225 \subsection{Usage}{
\r
226 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$setCollection(collection, setRecursively = TRUE)}\if{html}{\out{</div>}}
\r
230 \if{html}{\out{<hr>}}
\r
231 \if{html}{\out{<a id="method-getRelativePath"></a>}}
\r
232 \if{latex}{\out{\hypertarget{method-getRelativePath}{}}}
\r
233 \subsection{Method \code{getRelativePath()}}{
\r
234 Returns file path relative to the root.
\r
235 \subsection{Usage}{
\r
236 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getRelativePath()}\if{html}{\out{</div>}}
\r
240 \if{html}{\out{<hr>}}
\r
241 \if{html}{\out{<a id="method-getParent"></a>}}
\r
242 \if{latex}{\out{\hypertarget{method-getParent}{}}}
\r
243 \subsection{Method \code{getParent()}}{
\r
244 Returns project UUID.
\r
245 \subsection{Usage}{
\r
246 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getParent()}\if{html}{\out{</div>}}
\r
250 \if{html}{\out{<hr>}}
\r
251 \if{html}{\out{<a id="method-setParent"></a>}}
\r
252 \if{latex}{\out{\hypertarget{method-setParent}{}}}
\r
253 \subsection{Method \code{setParent()}}{
\r
254 Sets project collection.
\r
255 \subsection{Usage}{
\r
256 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$setParent(newParent)}\if{html}{\out{</div>}}
\r
260 \if{html}{\out{<hr>}}
\r
261 \if{html}{\out{<a id="method-read"></a>}}
\r
262 \if{latex}{\out{\hypertarget{method-read}{}}}
\r
263 \subsection{Method \code{read()}}{
\r
265 \subsection{Usage}{
\r
266 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$read(contentType = "raw", offset = 0, length = 0)}\if{html}{\out{</div>}}
\r
269 \subsection{Arguments}{
\r
270 \if{html}{\out{<div class="arguments">}}
\r
272 \item{\code{contentType}}{Type of content. Possible is "text", "raw".}
\r
274 \item{\code{offset}}{Describes the location of a piece of data compared to another location}
\r
276 \item{\code{length}}{Length of content}
\r
278 \if{html}{\out{</div>}}
\r
280 \subsection{Examples}{
\r
281 \if{html}{\out{<div class="r example copy">}}
\r
282 \preformatted{collection <- Collection$new(arv, collectionUUID)
\r
283 arvadosFile <- collection$get(fileName)
\r
284 fileContent <- arvadosFile$read("text")
\r
286 \if{html}{\out{</div>}}
\r
291 \if{html}{\out{<hr>}}
\r
292 \if{html}{\out{<a id="method-connection"></a>}}
\r
293 \if{latex}{\out{\hypertarget{method-connection}{}}}
\r
294 \subsection{Method \code{connection()}}{
\r
295 Get connection opened in "read" or "write" mode.
\r
296 \subsection{Usage}{
\r
297 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$connection(rw)}\if{html}{\out{</div>}}
\r
300 \subsection{Arguments}{
\r
301 \if{html}{\out{<div class="arguments">}}
\r
303 \item{\code{rw}}{Type of connection.}
\r
305 \if{html}{\out{</div>}}
\r
307 \subsection{Examples}{
\r
308 \if{html}{\out{<div class="r example copy">}}
\r
309 \preformatted{collection <- Collection$new(arv, collectionUUID)
\r
310 arvadosFile <- collection$get(fileName)
\r
311 arvConnection <- arvadosFile$connection("w")
\r
313 \if{html}{\out{</div>}}
\r
318 \if{html}{\out{<hr>}}
\r
319 \if{html}{\out{<a id="method-flush"></a>}}
\r
320 \if{latex}{\out{\hypertarget{method-flush}{}}}
\r
321 \subsection{Method \code{flush()}}{
\r
322 Write connections content to a file or override current content of the file.
\r
323 \subsection{Usage}{
\r
324 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$flush()}\if{html}{\out{</div>}}
\r
327 \subsection{Examples}{
\r
328 \if{html}{\out{<div class="r example copy">}}
\r
329 \preformatted{collection <- Collection$new(arv, collectionUUID)
\r
330 arvadosFile <- collection$get(fileName)
\r
331 myFile$write("This is new file content")
\r
332 arvadosFile$flush()
\r
334 \if{html}{\out{</div>}}
\r
339 \if{html}{\out{<hr>}}
\r
340 \if{html}{\out{<a id="method-write"></a>}}
\r
341 \if{latex}{\out{\hypertarget{method-write}{}}}
\r
342 \subsection{Method \code{write()}}{
\r
343 Write to file or override current content of the file.
\r
344 \subsection{Usage}{
\r
345 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$write(content, contentType = "text/html")}\if{html}{\out{</div>}}
\r
348 \subsection{Arguments}{
\r
349 \if{html}{\out{<div class="arguments">}}
\r
351 \item{\code{content}}{File to write.}
\r
353 \item{\code{contentType}}{Type of content. Possible is "text", "raw".}
\r
355 \if{html}{\out{</div>}}
\r
357 \subsection{Examples}{
\r
358 \if{html}{\out{<div class="r example copy">}}
\r
359 \preformatted{collection <- Collection$new(arv, collectionUUID)
\r
360 arvadosFile <- collection$get(fileName)
\r
361 myFile$write("This is new file content")
\r
363 \if{html}{\out{</div>}}
\r
368 \if{html}{\out{<hr>}}
\r
369 \if{html}{\out{<a id="method-move"></a>}}
\r
370 \if{latex}{\out{\hypertarget{method-move}{}}}
\r
371 \subsection{Method \code{move()}}{
\r
372 Moves file to a new location inside collection.
\r
373 \subsection{Usage}{
\r
374 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$move(destination)}\if{html}{\out{</div>}}
\r
377 \subsection{Arguments}{
\r
378 \if{html}{\out{<div class="arguments">}}
\r
380 \item{\code{destination}}{Path to new folder.}
\r
382 \if{html}{\out{</div>}}
\r
384 \subsection{Examples}{
\r
385 \if{html}{\out{<div class="r example copy">}}
\r
386 \preformatted{arvadosFile$move(newPath)
\r
388 \if{html}{\out{</div>}}
\r
393 \if{html}{\out{<hr>}}
\r
394 \if{html}{\out{<a id="method-copy"></a>}}
\r
395 \if{latex}{\out{\hypertarget{method-copy}{}}}
\r
396 \subsection{Method \code{copy()}}{
\r
397 Copies file to a new location inside collection.
\r
398 \subsection{Usage}{
\r
399 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$copy(destination)}\if{html}{\out{</div>}}
\r
402 \subsection{Arguments}{
\r
403 \if{html}{\out{<div class="arguments">}}
\r
405 \item{\code{destination}}{Path to new folder.}
\r
407 \if{html}{\out{</div>}}
\r
409 \subsection{Examples}{
\r
410 \if{html}{\out{<div class="r example copy">}}
\r
411 \preformatted{arvadosFile$copy("NewName.format")
\r
413 \if{html}{\out{</div>}}
\r
418 \if{html}{\out{<hr>}}
\r
419 \if{html}{\out{<a id="method-duplicate"></a>}}
\r
420 \if{latex}{\out{\hypertarget{method-duplicate}{}}}
\r
421 \subsection{Method \code{duplicate()}}{
\r
422 Duplicate file and gives it a new name.
\r
423 \subsection{Usage}{
\r
424 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$duplicate(newName = NULL)}\if{html}{\out{</div>}}
\r
427 \subsection{Arguments}{
\r
428 \if{html}{\out{<div class="arguments">}}
\r
430 \item{\code{newName}}{New name for duplicated file.}
\r
432 \if{html}{\out{</div>}}
\r