Class: BrickFTP::RESTfulAPI::DeleteFolder
- Inherits:
-
Object
- Object
- BrickFTP::RESTfulAPI::DeleteFolder
- Includes:
- Command
- Defined in:
- lib/brick_ftp/restful_api/delete_folder.rb
Overview
Delete a file or folder
Instance Method Summary collapse
-
#call(path, recursive: false) ⇒ Object
Deletes a file or folder.
Methods included from Command
Instance Method Details
#call(path, recursive: false) ⇒ Object
Deletes a file or folder.
Note that this operation works for both files and folders, but normally it will only work on empty folders.
If you want to recursively delete a folder and all its contents, send the request with a Depth header
with the value set to infinity.
23 24 25 26 27 28 29 |
# File 'lib/brick_ftp/restful_api/delete_folder.rb', line 23 def call(path, recursive: false) headers = {} headers = { 'Depth' => 'infinity' } if recursive client.delete("/api/rest/v1/files/#{ERB::Util.url_encode(path)}", headers) true end |