public function copy(
        LibraryType $srcLibrary,
        array $srcPaths,
        LibraryType $dstLibrary,
        string $dstDirectoryPath,
        int $operation = self::OPERATION_COPY
    ): bool {
        // do not allow empty paths
        if (empty($srcPaths) || empty($dstDirectoryPath)) {
            return false;
        }

        $operationMode = $operation === self::OPERATION_MOVE ? 'move' : 'copy';

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

        $dstFileNames = $this->preparePaths($srcFolderPath, $srcPaths);

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

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

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

        $response = $this->client->request(
            'POST',
            $uri,
            [
                'headers'   => ['Accept' => 'application/json'],
                'multipart' => [
                    [
                        'name'     => 'file_names',
                        'contents' => $dstFileNames,
                    ],
                    [
                        'name'     => 'dst_repo',
                        'contents' => $dstLibrary->id,
                    ],
                    [
                        'name'     => 'dst_dir',
                        'contents' => $dstDirectoryPath,
                    ],
                ],
            ]
        );

        return $response->getStatusCode() === 200;
    }