This will recursively download a folder from a LabKey Server using WebDAV.
labkey.webdav.downloadFolder(
localBaseDir,
baseUrl=NULL,
folderPath,
remoteFilePath,
overwriteFiles=TRUE,
mergeFolders=TRUE,
fileSet='@files',
showProgressBar=FALSE
)
TRUE or FALSE, depending on if this folder was successfully downloaded
the local filepath where this directory will be saved. a subfolder with the remote directory name will be created.
a string specifying the baseUrl
for the labkey server
a string specifying the folderPath
the path of this folder on the remote server, relative to the folder root.
(optional) if true, any pre-existing file at this location will be overwritten. Defaults to TRUE
(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
(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".
(optional) if true, a progress bar will be shown for all file downloads
Ben Bimber, Ph.D.
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.
labkey.webdav.get
,
labkey.webdav.put
,
labkey.webdav.mkDir
,
labkey.webdav.mkDirs
,
labkey.webdav.pathExists
,
labkey.webdav.listDir
,
labkey.webdav.delete
if (FALSE) {
## 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 DataLab