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));
}
}