21700: Install Bundler system-wide in Rails postinst
[arvados.git] / sdk / R / man / ArvadosFile.Rd
1 % Generated by roxygen2: do not edit by hand\r
2 % Please edit documentation in R/ArvadosFile.R\r
3 \name{ArvadosFile}\r
4 \alias{ArvadosFile}\r
5 \title{R6 Class Representing a ArvadosFile}\r
6 \description{\r
7 ArvadosFile class represents a file inside Arvados collection.\r
8 }\r
9 \examples{\r
10 \r
11 ## ------------------------------------------------\r
12 ## Method `ArvadosFile$new`\r
13 ## ------------------------------------------------\r
14 \r
15 \dontrun{\r
16 myFile   <- ArvadosFile$new("myFile")\r
17 }\r
18 \r
19 ## ------------------------------------------------\r
20 ## Method `ArvadosFile$getName`\r
21 ## ------------------------------------------------\r
22 \r
23 \dontrun{\r
24 arvadosFile$getName()\r
25 }\r
26 \r
27 ## ------------------------------------------------\r
28 ## Method `ArvadosFile$getFileListing`\r
29 ## ------------------------------------------------\r
30 \r
31 \dontrun{\r
32 arvadosFile$getFileListing()\r
33 }\r
34 \r
35 ## ------------------------------------------------\r
36 ## Method `ArvadosFile$getSizeInBytes`\r
37 ## ------------------------------------------------\r
38 \r
39 \dontrun{\r
40 arvadosFile$getSizeInBytes()\r
41 }\r
42 \r
43 ## ------------------------------------------------\r
44 ## Method `ArvadosFile$read`\r
45 ## ------------------------------------------------\r
46 \r
47 \dontrun{\r
48 collection <- Collection$new(arv, collectionUUID)\r
49 arvadosFile <- collection$get(fileName)\r
50 fileContent <- arvadosFile$read("text")\r
51 }\r
52 \r
53 ## ------------------------------------------------\r
54 ## Method `ArvadosFile$connection`\r
55 ## ------------------------------------------------\r
56 \r
57 \dontrun{\r
58 collection <- Collection$new(arv, collectionUUID)\r
59 arvadosFile <- collection$get(fileName)\r
60 arvConnection <- arvadosFile$connection("w")\r
61 }\r
62 \r
63 ## ------------------------------------------------\r
64 ## Method `ArvadosFile$flush`\r
65 ## ------------------------------------------------\r
66 \r
67 \dontrun{\r
68 collection <- Collection$new(arv, collectionUUID)\r
69 arvadosFile <- collection$get(fileName)\r
70 myFile$write("This is new file content")\r
71 arvadosFile$flush()\r
72 }\r
73 \r
74 ## ------------------------------------------------\r
75 ## Method `ArvadosFile$write`\r
76 ## ------------------------------------------------\r
77 \r
78 \dontrun{\r
79 collection <- Collection$new(arv, collectionUUID)\r
80 arvadosFile <- collection$get(fileName)\r
81 myFile$write("This is new file content")\r
82 }\r
83 \r
84 ## ------------------------------------------------\r
85 ## Method `ArvadosFile$move`\r
86 ## ------------------------------------------------\r
87 \r
88 \dontrun{\r
89 arvadosFile$move(newPath)\r
90 }\r
91 \r
92 ## ------------------------------------------------\r
93 ## Method `ArvadosFile$copy`\r
94 ## ------------------------------------------------\r
95 \r
96 \dontrun{\r
97 arvadosFile$copy("NewName.format")\r
98 }\r
99 }\r
100 \section{Methods}{\r
101 \subsection{Public methods}{\r
102 \itemize{\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
121 }\r
122 }\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
130 }\r
131 \r
132 \subsection{Arguments}{\r
133 \if{html}{\out{<div class="arguments">}}\r
134 \describe{\r
135 \item{\code{name}}{Name of the new enviroment.}\r
136 }\r
137 \if{html}{\out{</div>}}\r
138 }\r
139 \subsection{Returns}{\r
140 A new `ArvadosFile` object.\r
141 }\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
146 }\r
147 }\r
148 \if{html}{\out{</div>}}\r
149 \r
150 }\r
151 \r
152 }\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
160 }\r
161 \r
162 \subsection{Examples}{\r
163 \if{html}{\out{<div class="r example copy">}}\r
164 \preformatted{\dontrun{\r
165 arvadosFile$getName()\r
166 }\r
167 }\r
168 \if{html}{\out{</div>}}\r
169 \r
170 }\r
171 \r
172 }\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
180 }\r
181 \r
182 \subsection{Arguments}{\r
183 \if{html}{\out{<div class="arguments">}}\r
184 \describe{\r
185 \item{\code{fullPath}}{Checking if TRUE.}\r
186 }\r
187 \if{html}{\out{</div>}}\r
188 }\r
189 \subsection{Examples}{\r
190 \if{html}{\out{<div class="r example copy">}}\r
191 \preformatted{\dontrun{\r
192 arvadosFile$getFileListing()\r
193 }\r
194 }\r
195 \if{html}{\out{</div>}}\r
196 \r
197 }\r
198 \r
199 }\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
207 }\r
208 \r
209 \subsection{Examples}{\r
210 \if{html}{\out{<div class="r example copy">}}\r
211 \preformatted{\dontrun{\r
212 arvadosFile$getSizeInBytes()\r
213 }\r
214 }\r
215 \if{html}{\out{</div>}}\r
216 \r
217 }\r
218 \r
219 }\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
226 }\r
227 \r
228 }\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
235 }\r
236 \r
237 }\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
245 }\r
246 \r
247 }\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
255 }\r
256 \r
257 }\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
265 }\r
266 \r
267 }\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
275 }\r
276 \r
277 }\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
285 }\r
286 \r
287 }\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
292 Read file content.\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
295 }\r
296 \r
297 \subsection{Arguments}{\r
298 \if{html}{\out{<div class="arguments">}}\r
299 \describe{\r
300 \item{\code{contentType}}{Type of content. Possible is "text", "raw".}\r
301 \r
302 \item{\code{offset}}{Describes the location of a piece of data compared to another location}\r
303 \r
304 \item{\code{length}}{Length of content}\r
305 }\r
306 \if{html}{\out{</div>}}\r
307 }\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
314 }\r
315 }\r
316 \if{html}{\out{</div>}}\r
317 \r
318 }\r
319 \r
320 }\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
328 }\r
329 \r
330 \subsection{Arguments}{\r
331 \if{html}{\out{<div class="arguments">}}\r
332 \describe{\r
333 \item{\code{rw}}{Type of connection.}\r
334 }\r
335 \if{html}{\out{</div>}}\r
336 }\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
343 }\r
344 }\r
345 \if{html}{\out{</div>}}\r
346 \r
347 }\r
348 \r
349 }\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
357 }\r
358 \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
366 }\r
367 }\r
368 \if{html}{\out{</div>}}\r
369 \r
370 }\r
371 \r
372 }\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
380 }\r
381 \r
382 \subsection{Arguments}{\r
383 \if{html}{\out{<div class="arguments">}}\r
384 \describe{\r
385 \item{\code{content}}{File to write.}\r
386 \r
387 \item{\code{contentType}}{Type of content. Possible is "text", "raw".}\r
388 }\r
389 \if{html}{\out{</div>}}\r
390 }\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
397 }\r
398 }\r
399 \if{html}{\out{</div>}}\r
400 \r
401 }\r
402 \r
403 }\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
411 }\r
412 \r
413 \subsection{Arguments}{\r
414 \if{html}{\out{<div class="arguments">}}\r
415 \describe{\r
416 \item{\code{destination}}{Path to new folder.}\r
417 }\r
418 \if{html}{\out{</div>}}\r
419 }\r
420 \subsection{Examples}{\r
421 \if{html}{\out{<div class="r example copy">}}\r
422 \preformatted{\dontrun{\r
423 arvadosFile$move(newPath)\r
424 }\r
425 }\r
426 \if{html}{\out{</div>}}\r
427 \r
428 }\r
429 \r
430 }\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
438 }\r
439 \r
440 \subsection{Arguments}{\r
441 \if{html}{\out{<div class="arguments">}}\r
442 \describe{\r
443 \item{\code{destination}}{Path to new folder.}\r
444 }\r
445 \if{html}{\out{</div>}}\r
446 }\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
451 }\r
452 }\r
453 \if{html}{\out{</div>}}\r
454 \r
455 }\r
456 \r
457 }\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
465 }\r
466 \r
467 \subsection{Arguments}{\r
468 \if{html}{\out{<div class="arguments">}}\r
469 \describe{\r
470 \item{\code{newName}}{New name for duplicated file.}\r
471 }\r
472 \if{html}{\out{</div>}}\r
473 }\r
474 }\r
475 }\r