sharepoint_folder.RdInteract with sharepoint folders and their files.
Interact with sharepoint folders and their files.
siteName of the sharepoint site (readonly)
pathPath of the folder (readonly)
new()Create sharepoint_folder object to enable listing, creating downloading and uploading files & folders
sharepoint_folder$new(client, site, path, verify = FALSE)
clientA low-level sharepoint client object, which can be used to interact directly with the sharepoint API.
siteThe name of the sharepoint site (most likely a short string)
pathRelative path within that shared site. It seems that "Shared Documents" is a common path that most likely represents a "Documents" collection when viewed in the sharepoint web interface.
verifyLogical, indicating if the site/path combination is valid (slower but safer).
files()List all files within the folder
sharepoint_folder$files(path = NULL)
pathFolder relative to this folder, uses this folder if NULL
folders()List all folders within the folder
sharepoint_folder$folders(path = NULL)
pathFolder relative to this folder, uses this folder if NULL
list()List all folders and files within the folder; this is a
convenience wrapper around the files and folders methods.
sharepoint_folder$list(path = NULL)
pathFolder relative to this folder, uses this folder if NULL
delete()Delete a folder. Be extremely careful as you could use this to delete an entire sharepoint. Deleted files are sent to the recycle bin, so can be restored with relative ease, but it will still be alarming. There is a mechanism to prevent accidental deletion by declaring a file that exists within the folder.
sharepoint_folder$delete(path, check)
pathThe path to delete. Use NULL to delete the current
folder.
checkA file (not folder) that exists directly within
path, used as a method to verify that you really do want
to delete this folder (to prevent things like accidental deletion
of the entire sharepoint, for example).
parent()Create an object referring to the parent folder
sharepoint_folder$parent(verify = FALSE)
verifyVerify that the folder exists (which it must really here)
folder()Create an object referring to a child folder
sharepoint_folder$folder(path, verify = FALSE)
pathThe name of the folder, relative to this folder
verifyVerify that the folder exists (which it must really here)
create()Create a folder on sharepoint
sharepoint_folder$create(path)
pathFolder relative to this folder
download()Download a file from a folder
sharepoint_folder$download( path, dest = NULL, progress = FALSE, overwrite = FALSE )
pathThe name of the path to download, relative to this folder
destPath to save downloaded data to. If NULL then a
temporary file with the same file extension as path is used.
If coderaw() (or any other raw value) then the raw bytes will be
returned.
progressDisplay httr's progress bar?
overwriteOverwrite the file if it exists?
upload()Upload a file into a folder
sharepoint_folder$upload(path, dest = NULL, progress = FALSE)
pathThe name of the path to upload, absolute, or relative to R's working directory.
destRemote path save downloaded data to, relative to this
folder. If NULL then the basename of the file is used.
progressDisplay httr's progress bar?