public function generateMetadataHeaders(array $metadata)
    {
        $metadataHeaders = [];

        if (is_array($metadata) && !is_null($metadata)) {
            foreach ($metadata as $key => $value) {
                $headerName = Resources::X_MS_META_HEADER_PREFIX;
                if (strpos($value, "\r") !== false
                    || strpos($value, "\n") !== false
                ) {
                    throw new \InvalidArgumentException(Resources::INVALID_META_MSG);
                }

                $headerName .= strtolower($key);
                $metadataHeaders[$headerName] = $value;
            }
        }

        return $metadataHeaders;
    }