< prev index next >

src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 35,46 **** import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException; import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil; import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; import com.sun.xml.internal.messaging.saaj.util.FinalArrayList; - import java.util.logging.Level; - import java.util.logging.Logger; import javax.activation.DataHandler; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; --- 35,44 ----
*** 524,534 **** if (s == null) return null; // Tokenize the header to obtain the Language-tags (skip comments) HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME); ! FinalArrayList v = new FinalArrayList(); HeaderTokenizer.Token tk; int tkType; while (true) { --- 522,532 ---- if (s == null) return null; // Tokenize the header to obtain the Language-tags (skip comments) HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME); ! FinalArrayList<String> v = new FinalArrayList<String>(); HeaderTokenizer.Token tk; int tkType; while (true) {
*** 542,562 **** } if (v.size() == 0) return null; ! return (String[])v.toArray(new String[v.size()]); } /** * Set the Content-Language header of this MimeBodyPart. The * Content-Language header is defined by RFC 1766. * * @param languages array of language tags */ public void setContentLanguage(String[] languages) { ! StringBuffer sb = new StringBuffer(languages[0]); for (int i = 1; i < languages.length; i++) sb.append(',').append(languages[i]); setHeader("Content-Language", sb.toString()); } --- 540,560 ---- } if (v.size() == 0) return null; ! return v.toArray(new String[v.size()]); } /** * Set the Content-Language header of this MimeBodyPart. The * Content-Language header is defined by RFC 1766. * * @param languages array of language tags */ public void setContentLanguage(String[] languages) { ! StringBuilder sb = new StringBuilder(languages[0]); for (int i = 1; i < languages.length; i++) sb.append(',').append(languages[i]); setHeader("Content-Language", sb.toString()); }
*** 941,954 **** */ public void writeTo(OutputStream os) throws IOException, MessagingException { // First, write out the header ! List hdrLines = headers.getAllHeaderLines(); int sz = hdrLines.size(); for( int i=0; i<sz; i++ ) ! OutputUtil.writeln((String)hdrLines.get(i),os); // The CRLF separator between header and content OutputUtil.writeln(os); // Finally, the content. --- 939,952 ---- */ public void writeTo(OutputStream os) throws IOException, MessagingException { // First, write out the header ! List<String> hdrLines = headers.getAllHeaderLines(); int sz = hdrLines.size(); for( int i=0; i<sz; i++ ) ! OutputUtil.writeln(hdrLines.get(i),os); // The CRLF separator between header and content OutputUtil.writeln(os); // Finally, the content.
*** 1041,1051 **** /** * Return all the headers from this Message as an Enumeration of * Header objects. */ ! public FinalArrayList getAllHeaders() { return headers.getAllHeaders(); } /** --- 1039,1049 ---- /** * Return all the headers from this Message as an Enumeration of * Header objects. */ ! public FinalArrayList<hdr> getAllHeaders() { return headers.getAllHeaders(); } /**
< prev index next >