protected function parseMetadata($path, array $headers)
    {
        $metadata = [
            'path' => $path,
            'visibility' => $this->visibility,
            'mimetype' => $this->parseMimeType($path, $headers),
        ];

        if (false !== $timestamp = $this->parseTimestamp($headers)) {
            $metadata['timestamp'] = $timestamp;
        }

        if (isset($headers['content-length']) && is_numeric($headers['content-length'])) {
            $metadata['size'] = (int) $headers['content-length'];
        }

        return $metadata;
    }