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

de.mklinger.qetcher.client.httpclient.internal.jetty.HeadersTransformation Maven / Gradle / Ivy

There is a newer version: 2.0.42.rc
Show newest version
package de.mklinger.commons.httpclient.internal.jetty;

import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpFields;

import de.mklinger.commons.httpclient.HttpHeaders;
import de.mklinger.commons.httpclient.internal.HttpHeadersImpl;

/**
 * @author Marc Klinger - mklinger[at]mklinger[dot]de
 */
public class HeadersTransformation {
	public static HttpHeaders toHttpHeaders(final HttpFields jettyHeaders) {
		final HttpHeadersImpl httpHeaders = new HttpHeadersImpl();
		for (final HttpField jettyHeader : jettyHeaders) {
			final String name = jettyHeader.getName();
			for (final String value : jettyHeader.getValues()) {
				httpHeaders.addHeader(name, value);
			}
		}
		return httpHeaders;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy