public function create(LibraryType $library, DirectoryItem $item): bool
    {
        // do not allow empty paths
        if (empty($item->path) || empty($item->name)) {
            return false;
        }

        $uri = sprintf(
            '%s/repos/%s/file/?p=%s',
            $this->clipUri($this->client->getConfig('base_uri')),
            $library->id,
            $this->urlEncodePath($item->path . $item->name)
        );

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

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