< 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 +1,7 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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,12 +35,10 @@
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;
@@ -524,11 +522,11 @@
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();
+ FinalArrayList<String> v = new FinalArrayList<String>();
HeaderTokenizer.Token tk;
int tkType;
while (true) {
@@ -542,21 +540,21 @@
}
if (v.size() == 0)
return null;
- return (String[])v.toArray(new String[v.size()]);
+ 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) {
- StringBuffer sb = new StringBuffer(languages[0]);
+ 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,14 +939,14 @@
*/
public void writeTo(OutputStream os)
throws IOException, MessagingException {
// First, write out the header
- List hdrLines = headers.getAllHeaderLines();
+ List<String> hdrLines = headers.getAllHeaderLines();
int sz = hdrLines.size();
for( int i=0; i<sz; i++ )
- OutputUtil.writeln((String)hdrLines.get(i),os);
+ OutputUtil.writeln(hdrLines.get(i),os);
// The CRLF separator between header and content
OutputUtil.writeln(os);
// Finally, the content.
@@ -1041,11 +1039,11 @@
/**
* Return all the headers from this Message as an Enumeration of
* Header objects.
*/
- public FinalArrayList getAllHeaders() {
+ public FinalArrayList<hdr> getAllHeaders() {
return headers.getAllHeaders();
}
/**
< prev index next >