Learn R Programming

redcapAPI (version 2.7.4)

deleteFileRepository: Delete All Files from the File Repository

Description

Deletes all files in a folder of the file repository. The deletion may be applied recursively to sub-folders. Deleted files will remain in the recycling bin for up to 30 days. This function does not provide a way to delete folders.

Usage

deleteFileRepository(rcon, folder_id, recursive = FALSE, ...)

# S3 method for redcapApiConnection deleteFileRepository( rcon, folder_id, recursive = FALSE, refresh = TRUE, ..., confirm = c("ask", "no", "yes"), error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Arguments

rcon

A redcapConnection object.

folder_id

integerish(1). The folder ID from which files should be deleted. Use folder_id = 0 to delete from the top-level folder (this is different from other File Repository methods, which default to the top-level folder. The difference here is to prevent deleting an entire File Repository using a default argument.)

recursive

logical(1). If TRUE, files in all subfolders will be deleted as well.

...

Arguments to pass to other methods. File Repository data on rcon will be refreshed.

refresh

logical(1). If TRUE and the file repository

confirm

character. One of c("ask", "no", "yes"). When "ask", user will be prompted to confirm the deletion. When "no", the function will terminate with no action. When "yes", the function will proceed without confirmation (useful for automated processes).

error_handling

An option for how to handle errors returned by the API. see redcap_error

config

list Additional configuration parameters to pass to POST. These are appended to any parameters in rcon$config.

api_param

list Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

Author

Benjamin Nutter