本文整理汇总了Java中com.sun.xml.internal.messaging.saaj.packaging.mime.Header类的典型用法代码示例。如果您正苦于以下问题:Java Header类的具体用法?Java Header怎么用?Java Header使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Header类属于com.sun.xml.internal.messaging.saaj.packaging.mime包,在下文中一共展示了Header类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyMimeHeaders
import com.sun.xml.internal.messaging.saaj.packaging.mime.Header; //导入依赖的package包/类
public static void copyMimeHeaders(MimeBodyPart mbp, AttachmentPartImpl ap)
throws SOAPException {
try {
List hdr = mbp.getAllHeaders();
int sz = hdr.size();
for( int i=0; i<sz; i++ ) {
Header h = (Header)hdr.get(i);
if(h.getName().equalsIgnoreCase("Content-Type"))
continue; // skip
ap.addMimeHeader(h.getName(), h.getValue());
}
} catch (Exception ex) {
log.severe("SAAJ0506.soap.cannot.copy.mime.hdrs.into.attachment");
throw new SOAPExceptionImpl(
"Unable to copy MIME headers into attachment",
ex);
}
}
示例2: AttachmentPartImpl
import com.sun.xml.internal.messaging.saaj.packaging.mime.Header; //导入依赖的package包/类
public AttachmentPartImpl(MIMEPart part) {
headers = new MimeHeaders();
mimePart = part;
List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = part.getAllHeaders();
for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
headers.addHeader(hd.getName(), hd.getValue());
}
}
示例3: setMimeHeaders
import com.sun.xml.internal.messaging.saaj.packaging.mime.Header; //导入依赖的package包/类
private void setMimeHeaders(SOAPPart soapPart,
MimeBodyPart soapMessagePart) throws Exception {
// first remove the existing content-type
soapPart.removeAllMimeHeaders();
// add everything present in soapMessagePart
List headers = soapMessagePart.getAllHeaders();
int sz = headers.size();
for( int i=0; i<sz; i++ ) {
Header h = (Header) headers.get(i);
soapPart.addMimeHeader(h.getName(), h.getValue());
}
}
示例4: MimeBodyPart
import com.sun.xml.internal.messaging.saaj.packaging.mime.Header; //导入依赖的package包/类
public MimeBodyPart(MIMEPart part) {
mimePart = part;
headers = new InternetHeaders();
List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = mimePart.getAllHeaders();
for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
headers.addHeader(hd.getName(), hd.getValue());
}
}
示例5: getAllHeaders
import com.sun.xml.internal.messaging.saaj.packaging.mime.Header; //导入依赖的package包/类
/**
* Return all the headers as an Enumeration of
* {@link Header} objects.
*
* @return Header objects
*/
public List<? extends Header> getAllHeaders() {
return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here
}
示例6: getAllHeaders
import com.sun.xml.internal.messaging.saaj.packaging.mime.Header; //导入依赖的package包/类
/**
* Return all the headers from this Message as an Enumeration of
* Header objects.
*/
public List<? extends Header> getAllHeaders() {
return headers.getAllHeaders();
}