@param string $path
@param array  $metadata

@return \Psr\Http\Message\ResponseInterface

@link https://dev.onedrive.com/items/update.htm
193392
public function updateMetadata($path, array $metadata)
    {
        $url = self::BASE_URI.$this->getPathUnderRootDrive($path);

        return $this->getResponse('PATCH', $url, json_encode($metadata), ['Content-Type' => 'application/json']);
    }
1204068
public function getMetadata($path)
    {
        $location = $this->applyPathPrefix($path);

        try {
            $file = $this->share->stat($location);
        } catch (NotFoundException $e) {
            return false;
        }

        return $this->normalizeFileInfo($file);
    }
762691
public function head($path, array $parameters = [], array $requestHeaders = []): ResponseInterface
    {
        if (array_key_exists('ref', $parameters) && is_null($parameters['ref'])) {
            unset($parameters['ref']);
        }
        $response = $this->getHttpClient()->head($path . '?' . http_build_query($parameters), $requestHeaders);

        return $response;
    }
440727
public function getMetadata($path)
    {
        return $this->normalizeResponse(
            $this->cosApi->stat($this->getBucket(), $path)
        );
    }
1124736
public function createFolder($path)
    {
        $this->setupRequest([
            'path' => $this->normalizePath($path),
        ]);

        $this->apiEndpoint = 'files/create_folder';

        $response = $this->doDropboxApiRequest();
        $response['.tag'] = 'folder';

        return $response;
    }
1228096
public function getMetadata($path)
    {
        try {
            return $this->normalizeMetadata($this->api->resource($path));
        } catch (\Exception $e) {
            return false;
        }
    }
811502
protected function getAsResponse($path, array $parameters = array(), $requestHeaders = array())
    {
        $path = $this->preparePath($path, $parameters);

        return $this->client->getHttpClient()->get($path, $requestHeaders);
    }
991626
protected function buildRequest($path)
    {
        $request = new Request();
        $apiToken = $this->getApiToken();
        if ($apiToken !== '') {
            $request->getHeaders()->addHeaders(['API-Token' => $apiToken]);
        }
        $path = (string) $path;
        if ($path !== '' && $path[0] !== '/') {
            $path = '/' . $path;
        }
        $request->setUri($this->getEntryPoint() . $path);

        return $request;
    }
1025810
public function downloadAction(string $path): Response
    {
        if (!$meta = $this->filesystem->getMetadata($path)) {
            throw new NotFoundHttpException('Media not found: ' . $path);
        }

        $content = $this->filesystem->read($path);

        $response = new Response($content);
        $response->headers->set('Content-Type', $meta['mimetype']);
        $response->headers->set('Content-Length', $meta['size']);
        $response->headers->set('Content-Transfer-Encoding', 'binary');

        $name = explode('/', $path);

        $disposition = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $name[count($name) - 1]);
        $response->headers->set('Content-Disposition', $disposition);

        return $response;
    }
744362
public function setMetadata(string $metadata): self
    {
        $this->isValidString($metadata, 1000);

        $this->metadata = $metadata;

        return $this;
    }
240607
private function instantiateFromMetadata(Metadata $metadata)
    {
        $class = $metadata->getClass();

        if (!class_exists($class)) {
            throw new \RuntimeException(sprintf(
                'Document class "%s" does not exist', $class
            ));
        }

        $document = new $class();

        return $document;
    }
868076
public function put(string $path, $body): HttpResponse
    {
        return $this->request($path, HttpMethod::PUT, $body);
    }
966357
public function getMetadata(string $path): array
    {
        $parameters = [
            'path' => $this->normalizePath($path),
        ];

        return $this->rpcEndpointRequest('files/get_metadata', $parameters);
    }
364305
public function addMeta(\Sulu\Bundle\MediaBundle\Entity\FileVersionMeta $meta)
    {
        $this->meta[] = $meta;

        return $this;
    }
147606
public function getMetadata($path)
    {
        $bucketMgr = $this->getBucketManager();

        list($ret, $error) = $bucketMgr->stat($this->bucket, $path);
        if ($error !== null) {
            $this->logQiniuError($error);

            return false;
        } else {
            return $ret;
        }
    }
405647
public function generateUpdatedXmlEntityClass(ClassMetadataInfo $metadata, $path)
    {
        $currentCode = file_get_contents($path);

        $body = $this->generateXmlEntityBody($metadata);
        $body = str_replace('<spaces>', $this->spaces, $body);
        $last = strrpos($currentCode, '}');

        return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}";
    }
578165
public function metadata($metadata = null) {
        if ($metadata === null) {
            return $this->metadata;
        }

        $this->metadata = (bool) $metadata;

        return $this;
    }