20259: Add documentation for banner and tooltip features
[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 myFile   <- ArvadosFile$new("myFile")\r
16 \r
17 ## ------------------------------------------------\r
18 ## Method `ArvadosFile$getName`\r
19 ## ------------------------------------------------\r
20 \r
21 arvadosFile$getName()\r
22 \r
23 ## ------------------------------------------------\r
24 ## Method `ArvadosFile$getFileListing`\r
25 ## ------------------------------------------------\r
26 \r
27 arvadosFile$getFileListing()\r
28 \r
29 ## ------------------------------------------------\r
30 ## Method `ArvadosFile$getSizeInBytes`\r
31 ## ------------------------------------------------\r
32 \r
33 arvadosFile$getSizeInBytes()\r
34 \r
35 ## ------------------------------------------------\r
36 ## Method `ArvadosFile$read`\r
37 ## ------------------------------------------------\r
38 \r
39 collection <- Collection$new(arv, collectionUUID)\r
40 arvadosFile <- collection$get(fileName)\r
41 fileContent <- arvadosFile$read("text")\r
42 \r
43 ## ------------------------------------------------\r
44 ## Method `ArvadosFile$connection`\r
45 ## ------------------------------------------------\r
46 \r
47 collection <- Collection$new(arv, collectionUUID)\r
48 arvadosFile <- collection$get(fileName)\r
49 arvConnection <- arvadosFile$connection("w")\r
50 \r
51 ## ------------------------------------------------\r
52 ## Method `ArvadosFile$flush`\r
53 ## ------------------------------------------------\r
54 \r
55 collection <- Collection$new(arv, collectionUUID)\r
56 arvadosFile <- collection$get(fileName)\r
57 myFile$write("This is new file content")\r
58 arvadosFile$flush()\r
59 \r
60 ## ------------------------------------------------\r
61 ## Method `ArvadosFile$write`\r
62 ## ------------------------------------------------\r
63 \r
64 collection <- Collection$new(arv, collectionUUID)\r
65 arvadosFile <- collection$get(fileName)\r
66 myFile$write("This is new file content")\r
67 \r
68 ## ------------------------------------------------\r
69 ## Method `ArvadosFile$move`\r
70 ## ------------------------------------------------\r
71 \r
72 arvadosFile$move(newPath)\r
73 \r
74 ## ------------------------------------------------\r
75 ## Method `ArvadosFile$copy`\r
76 ## ------------------------------------------------\r
77 \r
78 arvadosFile$copy("NewName.format")\r
79 }\r
80 \section{Methods}{\r
81 \subsection{Public methods}{\r
82 \itemize{\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
101 }\r
102 }\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
110 }\r
111 \r
112 \subsection{Arguments}{\r
113 \if{html}{\out{<div class="arguments">}}\r
114 \describe{\r
115 \item{\code{name}}{Name of the new enviroment.}\r
116 }\r
117 \if{html}{\out{</div>}}\r
118 }\r
119 \subsection{Returns}{\r
120 A new `ArvadosFile` object.\r
121 }\r
122 \subsection{Examples}{\r
123 \if{html}{\out{<div class="r example copy">}}\r
124 \preformatted{myFile   <- ArvadosFile$new("myFile")\r
125 }\r
126 \if{html}{\out{</div>}}\r
127 \r
128 }\r
129 \r
130 }\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
138 }\r
139 \r
140 \subsection{Examples}{\r
141 \if{html}{\out{<div class="r example copy">}}\r
142 \preformatted{arvadosFile$getName()\r
143 }\r
144 \if{html}{\out{</div>}}\r
145 \r
146 }\r
147 \r
148 }\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
156 }\r
157 \r
158 \subsection{Arguments}{\r
159 \if{html}{\out{<div class="arguments">}}\r
160 \describe{\r
161 \item{\code{fullPath}}{Checking if TRUE.}\r
162 }\r
163 \if{html}{\out{</div>}}\r
164 }\r
165 \subsection{Examples}{\r
166 \if{html}{\out{<div class="r example copy">}}\r
167 \preformatted{arvadosFile$getFileListing()\r
168 }\r
169 \if{html}{\out{</div>}}\r
170 \r
171 }\r
172 \r
173 }\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
181 }\r
182 \r
183 \subsection{Examples}{\r
184 \if{html}{\out{<div class="r example copy">}}\r
185 \preformatted{arvadosFile$getSizeInBytes()\r
186 }\r
187 \if{html}{\out{</div>}}\r
188 \r
189 }\r
190 \r
191 }\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
198 }\r
199 \r
200 }\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
207 }\r
208 \r
209 }\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
217 }\r
218 \r
219 }\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
227 }\r
228 \r
229 }\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
237 }\r
238 \r
239 }\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
247 }\r
248 \r
249 }\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
257 }\r
258 \r
259 }\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
264 Read file content.\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
267 }\r
268 \r
269 \subsection{Arguments}{\r
270 \if{html}{\out{<div class="arguments">}}\r
271 \describe{\r
272 \item{\code{contentType}}{Type of content. Possible is "text", "raw".}\r
273 \r
274 \item{\code{offset}}{Describes the location of a piece of data compared to another location}\r
275 \r
276 \item{\code{length}}{Length of content}\r
277 }\r
278 \if{html}{\out{</div>}}\r
279 }\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
285 }\r
286 \if{html}{\out{</div>}}\r
287 \r
288 }\r
289 \r
290 }\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
298 }\r
299 \r
300 \subsection{Arguments}{\r
301 \if{html}{\out{<div class="arguments">}}\r
302 \describe{\r
303 \item{\code{rw}}{Type of connection.}\r
304 }\r
305 \if{html}{\out{</div>}}\r
306 }\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
312 }\r
313 \if{html}{\out{</div>}}\r
314 \r
315 }\r
316 \r
317 }\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
325 }\r
326 \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
333 }\r
334 \if{html}{\out{</div>}}\r
335 \r
336 }\r
337 \r
338 }\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
346 }\r
347 \r
348 \subsection{Arguments}{\r
349 \if{html}{\out{<div class="arguments">}}\r
350 \describe{\r
351 \item{\code{content}}{File to write.}\r
352 \r
353 \item{\code{contentType}}{Type of content. Possible is "text", "raw".}\r
354 }\r
355 \if{html}{\out{</div>}}\r
356 }\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
362 }\r
363 \if{html}{\out{</div>}}\r
364 \r
365 }\r
366 \r
367 }\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
375 }\r
376 \r
377 \subsection{Arguments}{\r
378 \if{html}{\out{<div class="arguments">}}\r
379 \describe{\r
380 \item{\code{destination}}{Path to new folder.}\r
381 }\r
382 \if{html}{\out{</div>}}\r
383 }\r
384 \subsection{Examples}{\r
385 \if{html}{\out{<div class="r example copy">}}\r
386 \preformatted{arvadosFile$move(newPath)\r
387 }\r
388 \if{html}{\out{</div>}}\r
389 \r
390 }\r
391 \r
392 }\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
400 }\r
401 \r
402 \subsection{Arguments}{\r
403 \if{html}{\out{<div class="arguments">}}\r
404 \describe{\r
405 \item{\code{destination}}{Path to new folder.}\r
406 }\r
407 \if{html}{\out{</div>}}\r
408 }\r
409 \subsection{Examples}{\r
410 \if{html}{\out{<div class="r example copy">}}\r
411 \preformatted{arvadosFile$copy("NewName.format")\r
412 }\r
413 \if{html}{\out{</div>}}\r
414 \r
415 }\r
416 \r
417 }\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
425 }\r
426 \r
427 \subsection{Arguments}{\r
428 \if{html}{\out{<div class="arguments">}}\r
429 \describe{\r
430 \item{\code{newName}}{New name for duplicated file.}\r
431 }\r
432 \if{html}{\out{</div>}}\r
433 }\r
434 }\r
435 }\r