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.
If true, will recursively delete folers. Otherwise, will error on non-empty folders.
21 22 23 24 25 26 27 |
# File 'lib/brick_ftp/restful_api/delete_folder.rb', line 21 def call(path, recursive: false) url = "/api/rest/v1/files/#{ERB::Util.url_encode(path)}" url += '?recursive=true' if recursive client.delete(url) true end |