SciDrive.download {SciServer}R Documentation

Download from SciDrive.

Description

Downloads a file (directory) from SciDrive into the local file system, or returns the file conetent as an object in several formats.

Usage

SciDrive.download(path, format="text", localFilePath=NULL)

Arguments

path

path of the file (or directory) in SciDrive.

format

Format of the returned R object that stores the data of the downloaded file. can take values of format="text" (the returned object is a string containing the text inside the file), format="raw" (raw binary format object is returned) and "response" (returned object is of type response in the httr library, i.e., the http response from the API call.). If the parameter 'localFilePath' is defined, then the 'format' parameter is not used and the file is downloaded to the local file system instead.

localFilePath

Local path of the file to be downloaded. If 'localFilePath' is defined, then the 'format' parameter is not used.

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. Throws an exception if the user is not logged into SciServer (use Authentication.login for that purpose). Throws an exception if the HTTP request to the SciDrive API returns an error.

Author(s)

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

References

http://www.sciserver.org
http://www.scidrive.org/scidrive
http://www.github.com/sciserver/SciScript-R

See Also

SciDrive.upload.

Examples


## Not run: 
csvString = SciDrive.download(path="path/to/SciDrive/file.csv", format="text")

## End(Not run)

[Package SciServer version 2.0.0 Index]