Files.download {SciServer}R Documentation

Download file or data

Description

Downloads a file from the remote file system into the local file system, or returns the file content as an object in several formats.

Usage

Jobs.download(fileService, path, localFilePath=NULL, format="txt", quiet=TRUE)

Arguments

fileService

name of fileService (string), or object (list) that defines a file service. A list of these kind of objects available to the user is returned by the function Files.getFileServices().

path

String defining the path (in the remote file service) of the file to be downloaded, starting from the root volume level. Example: rootVolume/userVolumeOwner/userVolume/fileToBeDownloaded.txt.

localFilePath

local destination path of the file to be downloaded. If set to NULL, then an object of format 'format' will be returned.

format

name (string) of the returned object's type (if localFilePath is not defined). This parameter can be "txt" , "raw" or "response". If the parameter 'localFilePath' is defined, then the 'format' parameter is not used and the file is downloaded to the local file system instead.

quiet

If set to FALSE, it will throw an error if the file does not exist. If set to TRUE. it will not throw an error.

Value

If the 'localFilePath' parameter is defined, then it will return TRUE when the file is downloaded successfully in the local file system. If the 'localFilePath' is not defined, then the type of the returned object depends on the value of the 'format' parameter.

Author(s)

Manuchehr Taghizadeh-Popp
Maintainer: Manuchehr Taghizadeh-Popp <mtaghiza@jhu.edu>

References

http://www.sciserver.org
http://apps.sciserver.org
http://apps.sciserver.org/dashboard/files
http://www.github.com/sciserver/SciScript-R

See Also

Files.getFileServices, Files.getFileServiceFromName, Files.delete, Files.createDir, Files.upload, Files.dirList, Files.createUserVolume

Examples

fileServices = Files.getFileServices(); isDownloaded = Files.download(fileServices[[1]], path="rootVolume/userVolumeOwner/userVolume/fileToBeDownloaded.txt", localFilePath="/myUploadedFile.txt");

[Package SciServer version 2.0.0 Index]