public function delete(LibraryType $library, array $paths): bool
    {
        // do not allow empty paths
        if (empty($paths)) {
            return false;
        }

        // get the folder path
        // this path must be the same for all files!
        $folderPath = dirname($paths[0]);

        $fileNames = $this->preparePaths($folderPath, $paths);

        if (empty($fileNames)) {
            return false;
        }

        $folderPath = str_replace("\\", "/", $folderPath); // windows compatibility

        $uri = sprintf(
            '%s/repos/%s/fileops/delete/?p=%s',
            $this->clipUri($this->client->getConfig('base_uri')),
            $library->id,
            $folderPath
        );

        $response = $this->client->request(
            'POST',
            $uri,
            [
                'headers'   => ['Accept' => 'application/json'],
                'multipart' => [
                    [
                        'name'     => 'file_names',
                        'contents' => $fileNames,
                    ],
                ],
            ]
        );

        return $response->getStatusCode() === 200;
    }
public function delete(LibraryType $library, array $paths): bool
    {
        // do not allow empty paths
        if (empty($paths)) {
            return false;
        }

        // get the folder path
        // this path must be the same for all files!
        $folderPath = dirname($paths[0]);

        $fileNames = $this->preparePaths($folderPath, $paths);

        if (empty($fileNames)) {
            return false;
        }

        $folderPath = str_replace("\\", "/", $folderPath); // windows compatibility

        $uri = sprintf(
            '%s/repos/%s/fileops/delete/?p=%s',
            $this->clipUri($this->client->getConfig('base_uri')),
            $library->id,
            $folderPath
        );

        $response = $this->client->request(
            'POST',
            $uri,
            [
                'headers'   => ['Accept' => 'application/json'],
                'multipart' => [
                    [
                        'name'     => 'file_names',
                        'contents' => $fileNames,
                    ],
                ],
            ]
        );

        return $response->getStatusCode() === 200;
    }
public function delete ( LibraryType $ library , array $ paths ) : bool { // do not allow empty paths if ( empty ( $ paths ) ) { return false ; } // get the folder path // this path must be the same for all files! $ folderPath = dirname ( $ paths [ 0 ] ) ; $ fileNames = $ this -> preparePaths ( $ folderPath , $ paths ) ; if ( empty ( $ fileNames ) ) { return false ; } $ folderPath = str_replace ( "\\" , "/" , $ folderPath ) ; // windows compatibility $ uri = sprintf ( '%s/repos/%s/fileops/delete/?p=%s' , $ this -> clipUri ( $ this -> client -> getConfig ( 'base_uri' ) ) , $ library -> id , $ folderPath ) ; $ response = $ this -> client -> request ( 'POST' , $ uri , [ 'headers' => [ 'Accept' => 'application/json' ] , 'multipart' => [ [ 'name' => 'file_names' , 'contents' => $ fileNames , ] , ] , ] ) ; return $ response -> getStatusCode ( ) === 200 ; }
Delete multiple files or folders

@param LibraryType $library Library object
@param array       $paths   Array with file and folder paths (they must be in the same folder)

@return bool
@throws \GuzzleHttp\Exception\GuzzleException
Delete multiple files or folders