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;
    }