Rlabkey (version 2.8.0)

labkey.webdav.downloadFolder: Recursively download a folder via WebDAV

Description

This will recursively download a folder from a LabKey Server using WebDAV.

Usage

labkey.webdav.downloadFolder(
    localBaseDir,
    baseUrl=NULL, 
    folderPath,
    remoteFilePath,
    overwriteFiles=TRUE,
    mergeFolders=TRUE,
    fileSet='@files'
    )

Arguments

localBaseDir

the local filepath where this directory will be saved. a subfolder with the remote directory name will be created.

baseUrl

a string specifying the baseUrl for the labkey server

folderPath

a string specifying the folderPath

remoteFilePath

the path of this folder on the remote server, relative to the folder root.

overwriteFiles

(optional) if true, any pre-existing file at this location will be overwritten. Defaults to TRUE

mergeFolders

(optional) if false, any pre-existing local folders in the target location will be deleted if there is an incoming folder of the same name. If true, these existing folders will be left alone, and remote files downloaded into them. Existing file conflicts will be handled based on the overwriteFiles parameter. Defaults to TRUE

fileSet

(optional) the name of file server fileSet, which is typically "@files" (the default value for this argument). In some cases this might be "@pipeline" or "@fileset".

Value

TRUE or FALSE, depending on if this folder was successfully downloaded

Details

This will recursively download a folder from a LabKey Server using WebDAV. This is essentially a wrapper that recursively calls labkey.webdav.get to download all files in the remote folder.

See Also

labkey.webdav.get, labkey.webdav.put, labkey.webdav.mkDir, labkey.webdav.mkDirs, labkey.webdav.pathExists, labkey.webdav.listDir, labkey.webdav.delete

Examples

Run this code
# NOT RUN {
## download folder from a LabKey Server
library(Rlabkey)

labkey.webdav.downloadFolder(baseUrl="http://labkey/",
    folderPath="home",
    remoteFilePath="folder1",
    localBaseDir="destFolder",
    overwrite=TRUE
)

# }

Run the code above in your browser using DataCamp Workspace