Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package org.glassfish.jersey.message.internal;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import javax.ws.rs.core.AbstractMultivaluedMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.RuntimeDelegate;
import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
import org.glassfish.jersey.internal.LocalizationMessages;
import org.glassfish.jersey.internal.util.collection.ImmutableMultivaluedMap;
import org.glassfish.jersey.internal.util.collection.StringKeyIgnoreCaseMultivaluedMap;
import org.glassfish.jersey.internal.util.collection.Views;
/**
* Utility class supporting the processing of message headers.
*
* @author Marek Potociar (marek.potociar at oracle.com)
* @author Michal Gajdos
* @author Libor Kramolis (libor.kramolis at oracle.com)
*/
public final class HeaderUtils {
private static final Logger LOGGER = Logger.getLogger(HeaderUtils.class.getName());
/**
* Create an empty inbound message headers container. Created container is mutable.
*
* @return a new empty mutable container for storing inbound message headers.
*/
public static AbstractMultivaluedMap createInbound() {
return new StringKeyIgnoreCaseMultivaluedMap();
}
/**
* Get immutable empty message headers container. The factory method can be
* used to for both message header container types – inbound
* as well as outbound.
*
* @param header value type. Typically {@link Object} in case of the outbound
* headers and {@link String} in case of the inbound headers.
* @return an immutable empty message headers container.
*/
public static MultivaluedMap empty() {
return ImmutableMultivaluedMap.empty();
}
/**
* Create an empty outbound message headers container. Created container is mutable.
*
* @return a new empty mutable container for storing outbound message headers.
*/
public static AbstractMultivaluedMap createOutbound() {
return new StringKeyIgnoreCaseMultivaluedMap