diff options
Diffstat (limited to 'apps/files_external/lib/ftp.php')
-rw-r--r-- | apps/files_external/lib/ftp.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index ca6c635eb2b..85d7a5a32ae 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -58,6 +58,22 @@ class FTP extends \OC\Files\Storage\StreamWrapper{ $url.='://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path; return $url; } + + /** + * Unlinks file or directory + * @param string @path + */ + public function unlink($path) { + if ($this->is_dir($path)) { + return $this->rmdir($path); + } + else { + $url = $this->constructUrl($path); + $result = unlink($url); + clearstatcache(true, $url); + return $result; + } + } public function fopen($path,$mode) { switch($mode) { case 'r': |