com.sun.xml.messaging.saaj.util.MimeHeadersUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of saaj-impl Show documentation
Show all versions of saaj-impl Show documentation
Open source Reference Implementation of JSR-67: SOAP with Attachments API for Java (SAAJ MR: 1.4)
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
*
* @author SAAJ RI Development Team
*/
package com.sun.xml.messaging.saaj.util;
import java.util.Iterator;
import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
public class MimeHeadersUtil {
public static MimeHeaders copy(MimeHeaders headers) {
MimeHeaders newHeaders = new MimeHeaders();
Iterator eachHeader = headers.getAllHeaders();
while (eachHeader.hasNext()) {
MimeHeader currentHeader = (MimeHeader) eachHeader.next();
newHeaders.addHeader(
currentHeader.getName(),
currentHeader.getValue());
}
return newHeaders;
}
}