Title: | R Package for Accessing Nextcloud Using WebDAV API |
---|---|
Description: | R package to access file infos or download data from an Nextcloud instance using the WebDav API (https://docs.nextcloud.com/server/17/developer_manual/client_apis/WebDAV/). |
Authors: | Michael Rustler [aut, cre] , Hauke Sonnenberg [aut] , ULTIMATE [fnd], Kompetenzzentrum Wasser Berlin gGmbH (KWB) [cph] |
Maintainer: | Michael Rustler <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.4.0 |
Built: | 2024-11-14 05:30:20 UTC |
Source: | https://github.com/KWB-R/kwb.nextcloud |
Zip cloud folder and download to local zip file. Default file name:
<backup_dir>/cloud-backup_<base_name>_<yyyy-mm-dd-HHMM>.zip
backup_cloud_folder( path, target_file = get_download_target_file(base_name, backup_dir), user = nextcloud_user(), auth = nextcloud_auth(), backup_dir = kwb.utils::createDirectory("~/../Downloads/nextcloud-backups"), base_name = basename(path) )
backup_cloud_folder( path, target_file = get_download_target_file(base_name, backup_dir), user = nextcloud_user(), auth = nextcloud_auth(), backup_dir = kwb.utils::createDirectory("~/../Downloads/nextcloud-backups"), base_name = basename(path) )
path |
path to folder on the cloud |
target_file |
path to the target file. A default path is provided by
|
user |
user name, by default taken from the environment variable "NEXTCLOUD_USER". |
auth |
authentication header as provided by
|
backup_dir |
directory into which to download the zip-file |
base_name |
base name to be integrated into the name of the downloaded file |
Compare two CSV files as retrieved by
list_files(..., full_info = TRUE)
compare_file_info_files(file_1, file_2, ...)
compare_file_info_files(file_1, file_2, ...)
file_1 |
path to first csv file |
file_2 |
path to second csv file |
... |
further arguments passed to |
Create a Folder on the Cloud
create_folder(path, user = nextcloud_user(), auth = nextcloud_auth())
create_folder(path, user = nextcloud_user(), auth = nextcloud_auth())
path |
path to the folder to be created |
user |
user name, by default taken from the environment variable "NEXTCLOUD_USER". |
auth |
authentication header as provided by
|
Delete a File or Folder on the Cloud
delete_file_or_folder( path, user = nextcloud_user(), auth = nextcloud_auth(), ... )
delete_file_or_folder( path, user = nextcloud_user(), auth = nextcloud_auth(), ... )
path |
path to the file or folder to be deleted |
user |
user name, by default taken from the environment variable "NEXTCLOUD_USER". |
auth |
authentication header as provided by
|
... |
further arguments passed to
|
Download Files from Cloud
download_files( hrefs = NULL, target_dir = create_download_dir("nextcloud_", dbg = dbg), paths = NULL, user = nextcloud_user(), auth = nextcloud_auth(), dbg = TRUE )
download_files( hrefs = NULL, target_dir = create_download_dir("nextcloud_", dbg = dbg), paths = NULL, user = nextcloud_user(), auth = nextcloud_auth(), dbg = TRUE )
hrefs |
href strings specifying the files to be downloaded. The href
strings are returned by |
target_dir |
path to local target directory |
paths |
Alternatively to givin the href strings, the paths to the files can be given in this argument. |
user |
name of nextcloud user. Default: result of calling
|
auth |
authentication as returned by
|
dbg |
logical indicating whether or not to show debug messages |
Does a File Exist on the Nextcloud Server?
file_exists(path)
file_exists(path)
path |
path to the file |
TRUE
if the file exists, else FALSE
Get Information on Versions of Given Files
get_file_versions(file_info)
get_file_versions(file_info)
file_info |
data frame as returned by |
data frame
Get Version Information on Files of Given IDs
get_version_info( file_ids, user = nextcloud_user(), ignore = "^(status|quota|getcontent|resource)", dbg = TRUE )
get_version_info( file_ids, user = nextcloud_user(), ignore = "^(status|quota|getcontent|resource)", dbg = TRUE )
file_ids |
vector of integer representing file ids (values returned in
column |
user |
nextcloud user |
ignore |
pattern matching columns to be excluded from the result. Set
to |
dbg |
logical indicating whether or not to print debug messages |
data frame with one row per version. There seems to be only an entry if the corresponding file as more than one version.
Pleas use get_file_versions
instead.
list_file_versions(path, pattern = NULL, ...)
list_file_versions(path, pattern = NULL, ...)
path |
relative path to folder of which file versions are to be listed |
pattern |
optional. If specified, only files with names matching the pattern are considered. |
... |
additional arguments passed to |
List Files on the Nextcloud Server
list_files( path = "", pattern = NULL, recursive = FALSE, full_info = FALSE, user = nextcloud_user(), auth = nextcloud_auth(), max_depth = NA, ... )
list_files( path = "", pattern = NULL, recursive = FALSE, full_info = FALSE, user = nextcloud_user(), auth = nextcloud_auth(), max_depth = NA, ... )
path |
path to the nextcloud folder to be listed |
pattern |
an optional regular expression. Only file names which match the regular expression will be returned. |
recursive |
if |
full_info |
if |
user |
user name, by default taken from the environment variable "NEXTCLOUD_USER". |
auth |
authentication header as provided by
|
max_depth |
maximum recursion depth if |
... |
further arguments passed to
|
vector of character or data frame, each with attribute "root" being
set to the value of path
.
Move a File or Folder on the Cloud
move_file_or_folder( path, path_target, overwrite = FALSE, user = nextcloud_user(), auth = nextcloud_auth(), dbg = TRUE, ... )
move_file_or_folder( path, path_target, overwrite = FALSE, user = nextcloud_user(), auth = nextcloud_auth(), dbg = TRUE, ... )
path |
path to the file or folder to be moved |
path_target |
path to the target file or folder to be moved to |
overwrite |
whether to overwrite the file or folder in case that the file or folder already exists (default: FALSE) |
user |
user name, by default taken from the environment variable "NEXTCLOUD_USER". |
auth |
authentication header as provided by
|
dbg |
print debug messages (default: TRUE) |
... |
further arguments passed to
|
return path_target of moved file/folder
Convert Path to href as Required for Download
path_to_file_href(path = "", user = nextcloud_user(), leading_slash = FALSE)
path_to_file_href(path = "", user = nextcloud_user(), leading_slash = FALSE)
path |
path to file on Nextcloud server |
user |
name of Nextcloud user, default:
|
leading_slash |
should the returned href start with a slash? |
Upload a Local File to the Cloud
upload_file( file, target_path = "documents", user = nextcloud_user(), auth = nextcloud_auth() )
upload_file( file, target_path = "documents", user = nextcloud_user(), auth = nextcloud_auth() )
file |
path to local file |
target_path |
path to folder on the cloud into which to upload the file |
user |
user name, by default taken from the environment variable "NEXTCLOUD_USER". |
auth |
authentication header as provided by
|