All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.bottomlessarchive.warc.service.header.HeaderParser Maven / Gradle / Ivy

package com.github.bottomlessarchive.warc.service.header;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.http.HttpMessage;
import org.apache.http.NameValuePair;

public class HeaderParser {

    public Map parseHeaders(final HttpMessage message) {
        return Arrays.stream(message.getAllHeaders())
            .collect(Collectors.toMap(NameValuePair::getName, NameValuePair::getValue,
                (headerOne, headerTwo) -> headerOne));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy