Class: BrickFTP::RESTfulAPI::CopyFolder

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/brick_ftp/restful_api/copy_folder.rb

Overview

Copy a file or folder

Params

PARAMETER TYPE DESCRIPTION
copy-destination string Full path of the file or folder. Maximum of 550 characters.
structure any Optionally, provide the parameter structure and set it to any value to only copy the folder structure without copying any files.

Defined Under Namespace

Classes: Params

Instance Method Summary collapse

Methods included from Command

included, #initialize

Instance Method Details

#call(path, params) ⇒ Object

Copies a file or folder to the destination provided in the copy-destination parameter in the request body. Note that a copy will fail if the destination already exists.

Optionally, provide the parameter structure and set it to any value to only copy the folder structure without copying any files.

Parameters:



40
41
42
43
# File 'lib/brick_ftp/restful_api/copy_folder.rb', line 40

def call(path, params)
  client.post("/api/rest/v1/files/#{ERB::Util.url_encode(path)}", params.to_h.compact)
  true
end