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
16 myFile <- ArvadosFile$new("myFile")
\r
19 ## ------------------------------------------------
\r
20 ## Method `ArvadosFile$getName`
\r
21 ## ------------------------------------------------
\r
24 arvadosFile$getName()
\r
27 ## ------------------------------------------------
\r
28 ## Method `ArvadosFile$getFileListing`
\r
29 ## ------------------------------------------------
\r
32 arvadosFile$getFileListing()
\r
35 ## ------------------------------------------------
\r
36 ## Method `ArvadosFile$getSizeInBytes`
\r
37 ## ------------------------------------------------
\r
40 arvadosFile$getSizeInBytes()
\r
43 ## ------------------------------------------------
\r
44 ## Method `ArvadosFile$read`
\r
45 ## ------------------------------------------------
\r
48 collection <- Collection$new(arv, collectionUUID)
\r
49 arvadosFile <- collection$get(fileName)
\r
50 fileContent <- arvadosFile$read("text")
\r
53 ## ------------------------------------------------
\r
54 ## Method `ArvadosFile$connection`
\r
55 ## ------------------------------------------------
\r
58 collection <- Collection$new(arv, collectionUUID)
\r
59 arvadosFile <- collection$get(fileName)
\r
60 arvConnection <- arvadosFile$connection("w")
\r
63 ## ------------------------------------------------
\r
64 ## Method `ArvadosFile$flush`
\r
65 ## ------------------------------------------------
\r
68 collection <- Collection$new(arv, collectionUUID)
\r
69 arvadosFile <- collection$get(fileName)
\r
70 myFile$write("This is new file content")
\r
74 ## ------------------------------------------------
\r
75 ## Method `ArvadosFile$write`
\r
76 ## ------------------------------------------------
\r
79 collection <- Collection$new(arv, collectionUUID)
\r
80 arvadosFile <- collection$get(fileName)
\r
81 myFile$write("This is new file content")
\r
84 ## ------------------------------------------------
\r
85 ## Method `ArvadosFile$move`
\r
86 ## ------------------------------------------------
\r
89 arvadosFile$move(newPath)
\r
92 ## ------------------------------------------------
\r
93 ## Method `ArvadosFile$copy`
\r
94 ## ------------------------------------------------
\r
97 arvadosFile$copy("NewName.format")
\r
101 \subsection{Public methods}{
\r
103 \item \href{#method-ArvadosFile-new}{\code{ArvadosFile$new()}}
\r
104 \item \href{#method-ArvadosFile-getName}{\code{ArvadosFile$getName()}}
\r
105 \item \href{#method-ArvadosFile-getFileListing}{\code{ArvadosFile$getFileListing()}}
\r
106 \item \href{#method-ArvadosFile-getSizeInBytes}{\code{ArvadosFile$getSizeInBytes()}}
\r
107 \item \href{#method-ArvadosFile-get}{\code{ArvadosFile$get()}}
\r
108 \item \href{#method-ArvadosFile-getFirst}{\code{ArvadosFile$getFirst()}}
\r
109 \item \href{#method-ArvadosFile-getCollection}{\code{ArvadosFile$getCollection()}}
\r
110 \item \href{#method-ArvadosFile-setCollection}{\code{ArvadosFile$setCollection()}}
\r
111 \item \href{#method-ArvadosFile-getRelativePath}{\code{ArvadosFile$getRelativePath()}}
\r
112 \item \href{#method-ArvadosFile-getParent}{\code{ArvadosFile$getParent()}}
\r
113 \item \href{#method-ArvadosFile-setParent}{\code{ArvadosFile$setParent()}}
\r
114 \item \href{#method-ArvadosFile-read}{\code{ArvadosFile$read()}}
\r
115 \item \href{#method-ArvadosFile-connection}{\code{ArvadosFile$connection()}}
\r
116 \item \href{#method-ArvadosFile-flush}{\code{ArvadosFile$flush()}}
\r
117 \item \href{#method-ArvadosFile-write}{\code{ArvadosFile$write()}}
\r
118 \item \href{#method-ArvadosFile-move}{\code{ArvadosFile$move()}}
\r
119 \item \href{#method-ArvadosFile-copy}{\code{ArvadosFile$copy()}}
\r
120 \item \href{#method-ArvadosFile-duplicate}{\code{ArvadosFile$duplicate()}}
\r
123 \if{html}{\out{<hr>}}
\r
124 \if{html}{\out{<a id="method-ArvadosFile-new"></a>}}
\r
125 \if{latex}{\out{\hypertarget{method-ArvadosFile-new}{}}}
\r
126 \subsection{Method \code{new()}}{
\r
127 Initialize new enviroment.
\r
128 \subsection{Usage}{
\r
129 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$new(name)}\if{html}{\out{</div>}}
\r
132 \subsection{Arguments}{
\r
133 \if{html}{\out{<div class="arguments">}}
\r
135 \item{\code{name}}{Name of the new enviroment.}
\r
137 \if{html}{\out{</div>}}
\r
139 \subsection{Returns}{
\r
140 A new `ArvadosFile` object.
\r
142 \subsection{Examples}{
\r
143 \if{html}{\out{<div class="r example copy">}}
\r
144 \preformatted{\dontrun{
\r
145 myFile <- ArvadosFile$new("myFile")
\r
148 \if{html}{\out{</div>}}
\r
153 \if{html}{\out{<hr>}}
\r
154 \if{html}{\out{<a id="method-ArvadosFile-getName"></a>}}
\r
155 \if{latex}{\out{\hypertarget{method-ArvadosFile-getName}{}}}
\r
156 \subsection{Method \code{getName()}}{
\r
157 Returns name of the file.
\r
158 \subsection{Usage}{
\r
159 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getName()}\if{html}{\out{</div>}}
\r
162 \subsection{Examples}{
\r
163 \if{html}{\out{<div class="r example copy">}}
\r
164 \preformatted{\dontrun{
\r
165 arvadosFile$getName()
\r
168 \if{html}{\out{</div>}}
\r
173 \if{html}{\out{<hr>}}
\r
174 \if{html}{\out{<a id="method-ArvadosFile-getFileListing"></a>}}
\r
175 \if{latex}{\out{\hypertarget{method-ArvadosFile-getFileListing}{}}}
\r
176 \subsection{Method \code{getFileListing()}}{
\r
177 Returns collections file content as character vector.
\r
178 \subsection{Usage}{
\r
179 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getFileListing(fullpath = TRUE)}\if{html}{\out{</div>}}
\r
182 \subsection{Arguments}{
\r
183 \if{html}{\out{<div class="arguments">}}
\r
185 \item{\code{fullPath}}{Checking if TRUE.}
\r
187 \if{html}{\out{</div>}}
\r
189 \subsection{Examples}{
\r
190 \if{html}{\out{<div class="r example copy">}}
\r
191 \preformatted{\dontrun{
\r
192 arvadosFile$getFileListing()
\r
195 \if{html}{\out{</div>}}
\r
200 \if{html}{\out{<hr>}}
\r
201 \if{html}{\out{<a id="method-ArvadosFile-getSizeInBytes"></a>}}
\r
202 \if{latex}{\out{\hypertarget{method-ArvadosFile-getSizeInBytes}{}}}
\r
203 \subsection{Method \code{getSizeInBytes()}}{
\r
204 Returns collections content size in bytes.
\r
205 \subsection{Usage}{
\r
206 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getSizeInBytes()}\if{html}{\out{</div>}}
\r
209 \subsection{Examples}{
\r
210 \if{html}{\out{<div class="r example copy">}}
\r
211 \preformatted{\dontrun{
\r
212 arvadosFile$getSizeInBytes()
\r
215 \if{html}{\out{</div>}}
\r
220 \if{html}{\out{<hr>}}
\r
221 \if{html}{\out{<a id="method-ArvadosFile-get"></a>}}
\r
222 \if{latex}{\out{\hypertarget{method-ArvadosFile-get}{}}}
\r
223 \subsection{Method \code{get()}}{
\r
224 \subsection{Usage}{
\r
225 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$get(fileLikeObjectName)}\if{html}{\out{</div>}}
\r
229 \if{html}{\out{<hr>}}
\r
230 \if{html}{\out{<a id="method-ArvadosFile-getFirst"></a>}}
\r
231 \if{latex}{\out{\hypertarget{method-ArvadosFile-getFirst}{}}}
\r
232 \subsection{Method \code{getFirst()}}{
\r
233 \subsection{Usage}{
\r
234 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getFirst()}\if{html}{\out{</div>}}
\r
238 \if{html}{\out{<hr>}}
\r
239 \if{html}{\out{<a id="method-ArvadosFile-getCollection"></a>}}
\r
240 \if{latex}{\out{\hypertarget{method-ArvadosFile-getCollection}{}}}
\r
241 \subsection{Method \code{getCollection()}}{
\r
242 Returns collection UUID.
\r
243 \subsection{Usage}{
\r
244 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getCollection()}\if{html}{\out{</div>}}
\r
248 \if{html}{\out{<hr>}}
\r
249 \if{html}{\out{<a id="method-ArvadosFile-setCollection"></a>}}
\r
250 \if{latex}{\out{\hypertarget{method-ArvadosFile-setCollection}{}}}
\r
251 \subsection{Method \code{setCollection()}}{
\r
252 Sets new collection.
\r
253 \subsection{Usage}{
\r
254 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$setCollection(collection, setRecursively = TRUE)}\if{html}{\out{</div>}}
\r
258 \if{html}{\out{<hr>}}
\r
259 \if{html}{\out{<a id="method-ArvadosFile-getRelativePath"></a>}}
\r
260 \if{latex}{\out{\hypertarget{method-ArvadosFile-getRelativePath}{}}}
\r
261 \subsection{Method \code{getRelativePath()}}{
\r
262 Returns file path relative to the root.
\r
263 \subsection{Usage}{
\r
264 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getRelativePath()}\if{html}{\out{</div>}}
\r
268 \if{html}{\out{<hr>}}
\r
269 \if{html}{\out{<a id="method-ArvadosFile-getParent"></a>}}
\r
270 \if{latex}{\out{\hypertarget{method-ArvadosFile-getParent}{}}}
\r
271 \subsection{Method \code{getParent()}}{
\r
272 Returns project UUID.
\r
273 \subsection{Usage}{
\r
274 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$getParent()}\if{html}{\out{</div>}}
\r
278 \if{html}{\out{<hr>}}
\r
279 \if{html}{\out{<a id="method-ArvadosFile-setParent"></a>}}
\r
280 \if{latex}{\out{\hypertarget{method-ArvadosFile-setParent}{}}}
\r
281 \subsection{Method \code{setParent()}}{
\r
282 Sets project collection.
\r
283 \subsection{Usage}{
\r
284 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$setParent(newParent)}\if{html}{\out{</div>}}
\r
288 \if{html}{\out{<hr>}}
\r
289 \if{html}{\out{<a id="method-ArvadosFile-read"></a>}}
\r
290 \if{latex}{\out{\hypertarget{method-ArvadosFile-read}{}}}
\r
291 \subsection{Method \code{read()}}{
\r
293 \subsection{Usage}{
\r
294 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$read(contentType = "raw", offset = 0, length = 0)}\if{html}{\out{</div>}}
\r
297 \subsection{Arguments}{
\r
298 \if{html}{\out{<div class="arguments">}}
\r
300 \item{\code{contentType}}{Type of content. Possible is "text", "raw".}
\r
302 \item{\code{offset}}{Describes the location of a piece of data compared to another location}
\r
304 \item{\code{length}}{Length of content}
\r
306 \if{html}{\out{</div>}}
\r
308 \subsection{Examples}{
\r
309 \if{html}{\out{<div class="r example copy">}}
\r
310 \preformatted{\dontrun{
\r
311 collection <- Collection$new(arv, collectionUUID)
\r
312 arvadosFile <- collection$get(fileName)
\r
313 fileContent <- arvadosFile$read("text")
\r
316 \if{html}{\out{</div>}}
\r
321 \if{html}{\out{<hr>}}
\r
322 \if{html}{\out{<a id="method-ArvadosFile-connection"></a>}}
\r
323 \if{latex}{\out{\hypertarget{method-ArvadosFile-connection}{}}}
\r
324 \subsection{Method \code{connection()}}{
\r
325 Get connection opened in "read" or "write" mode.
\r
326 \subsection{Usage}{
\r
327 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$connection(rw)}\if{html}{\out{</div>}}
\r
330 \subsection{Arguments}{
\r
331 \if{html}{\out{<div class="arguments">}}
\r
333 \item{\code{rw}}{Type of connection.}
\r
335 \if{html}{\out{</div>}}
\r
337 \subsection{Examples}{
\r
338 \if{html}{\out{<div class="r example copy">}}
\r
339 \preformatted{\dontrun{
\r
340 collection <- Collection$new(arv, collectionUUID)
\r
341 arvadosFile <- collection$get(fileName)
\r
342 arvConnection <- arvadosFile$connection("w")
\r
345 \if{html}{\out{</div>}}
\r
350 \if{html}{\out{<hr>}}
\r
351 \if{html}{\out{<a id="method-ArvadosFile-flush"></a>}}
\r
352 \if{latex}{\out{\hypertarget{method-ArvadosFile-flush}{}}}
\r
353 \subsection{Method \code{flush()}}{
\r
354 Write connections content to a file or override current content of the file.
\r
355 \subsection{Usage}{
\r
356 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$flush()}\if{html}{\out{</div>}}
\r
359 \subsection{Examples}{
\r
360 \if{html}{\out{<div class="r example copy">}}
\r
361 \preformatted{\dontrun{
\r
362 collection <- Collection$new(arv, collectionUUID)
\r
363 arvadosFile <- collection$get(fileName)
\r
364 myFile$write("This is new file content")
\r
365 arvadosFile$flush()
\r
368 \if{html}{\out{</div>}}
\r
373 \if{html}{\out{<hr>}}
\r
374 \if{html}{\out{<a id="method-ArvadosFile-write"></a>}}
\r
375 \if{latex}{\out{\hypertarget{method-ArvadosFile-write}{}}}
\r
376 \subsection{Method \code{write()}}{
\r
377 Write to file or override current content of the file.
\r
378 \subsection{Usage}{
\r
379 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$write(content, contentType = "text/html")}\if{html}{\out{</div>}}
\r
382 \subsection{Arguments}{
\r
383 \if{html}{\out{<div class="arguments">}}
\r
385 \item{\code{content}}{File to write.}
\r
387 \item{\code{contentType}}{Type of content. Possible is "text", "raw".}
\r
389 \if{html}{\out{</div>}}
\r
391 \subsection{Examples}{
\r
392 \if{html}{\out{<div class="r example copy">}}
\r
393 \preformatted{\dontrun{
\r
394 collection <- Collection$new(arv, collectionUUID)
\r
395 arvadosFile <- collection$get(fileName)
\r
396 myFile$write("This is new file content")
\r
399 \if{html}{\out{</div>}}
\r
404 \if{html}{\out{<hr>}}
\r
405 \if{html}{\out{<a id="method-ArvadosFile-move"></a>}}
\r
406 \if{latex}{\out{\hypertarget{method-ArvadosFile-move}{}}}
\r
407 \subsection{Method \code{move()}}{
\r
408 Moves file to a new location inside collection.
\r
409 \subsection{Usage}{
\r
410 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$move(destination)}\if{html}{\out{</div>}}
\r
413 \subsection{Arguments}{
\r
414 \if{html}{\out{<div class="arguments">}}
\r
416 \item{\code{destination}}{Path to new folder.}
\r
418 \if{html}{\out{</div>}}
\r
420 \subsection{Examples}{
\r
421 \if{html}{\out{<div class="r example copy">}}
\r
422 \preformatted{\dontrun{
\r
423 arvadosFile$move(newPath)
\r
426 \if{html}{\out{</div>}}
\r
431 \if{html}{\out{<hr>}}
\r
432 \if{html}{\out{<a id="method-ArvadosFile-copy"></a>}}
\r
433 \if{latex}{\out{\hypertarget{method-ArvadosFile-copy}{}}}
\r
434 \subsection{Method \code{copy()}}{
\r
435 Copies file to a new location inside collection.
\r
436 \subsection{Usage}{
\r
437 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$copy(destination)}\if{html}{\out{</div>}}
\r
440 \subsection{Arguments}{
\r
441 \if{html}{\out{<div class="arguments">}}
\r
443 \item{\code{destination}}{Path to new folder.}
\r
445 \if{html}{\out{</div>}}
\r
447 \subsection{Examples}{
\r
448 \if{html}{\out{<div class="r example copy">}}
\r
449 \preformatted{\dontrun{
\r
450 arvadosFile$copy("NewName.format")
\r
453 \if{html}{\out{</div>}}
\r
458 \if{html}{\out{<hr>}}
\r
459 \if{html}{\out{<a id="method-ArvadosFile-duplicate"></a>}}
\r
460 \if{latex}{\out{\hypertarget{method-ArvadosFile-duplicate}{}}}
\r
461 \subsection{Method \code{duplicate()}}{
\r
462 Duplicate file and gives it a new name.
\r
463 \subsection{Usage}{
\r
464 \if{html}{\out{<div class="r">}}\preformatted{ArvadosFile$duplicate(newName = NULL)}\if{html}{\out{</div>}}
\r
467 \subsection{Arguments}{
\r
468 \if{html}{\out{<div class="arguments">}}
\r
470 \item{\code{newName}}{New name for duplicated file.}
\r
472 \if{html}{\out{</div>}}
\r