de.mklinger.qetcher.client.httpclient.internal.jetty.HeadersTransformation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qetcher-client-bundle Show documentation
Show all versions of qetcher-client-bundle Show documentation
Qetcher Java client, OSGi bundle, minimal dependencies
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