< prev index next >
src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.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
*** 91,101 ****
protected boolean parsed = true;
/**
* Vector of MimeBodyPart objects.
*/
! protected FinalArrayList parts = new FinalArrayList(); // Holds BodyParts
/**
* This field specifies the content-type of this multipart
* object. It defaults to "multipart/mixed".
*/
--- 91,101 ----
protected boolean parsed = true;
/**
* Vector of MimeBodyPart objects.
*/
! protected FinalArrayList<MimeBodyPart> parts = new FinalArrayList<MimeBodyPart>(); // Holds BodyParts
/**
* This field specifies the content-type of this multipart
* object. It defaults to "multipart/mixed".
*/
*** 210,220 ****
throws MessagingException {
parse();
if (parts == null)
throw new IndexOutOfBoundsException("No such BodyPart");
! return (MimeBodyPart)parts.get(index);
}
/**
* Get the MimeBodyPart referred to by the given ContentID (CID).
* Returns null if the part is not found.
--- 210,220 ----
throws MessagingException {
parse();
if (parts == null)
throw new IndexOutOfBoundsException("No such BodyPart");
! return parts.get(index);
}
/**
* Get the MimeBodyPart referred to by the given ContentID (CID).
* Returns null if the part is not found.
*** 257,267 ****
* might itself want to track whether its internal state actually
* did change, and do the header updating only if necessary.
*/
protected void updateHeaders() throws MessagingException {
for (int i = 0; i < parts.size(); i++)
! ((MimeBodyPart)parts.get(i)).updateHeaders();
}
/**
* Iterates through all the parts and outputs each Mime part
* separated by a boundary.
--- 257,267 ----
* might itself want to track whether its internal state actually
* did change, and do the header updating only if necessary.
*/
protected void updateHeaders() throws MessagingException {
for (int i = 0; i < parts.size(); i++)
! parts.get(i).updateHeaders();
}
/**
* Iterates through all the parts and outputs each Mime part
* separated by a boundary.
*** 594,604 ****
*/
public void removeBodyPart(int index) {
if (parts == null)
throw new IndexOutOfBoundsException("No such BodyPart");
! MimeBodyPart part = (MimeBodyPart)parts.get(index);
parts.remove(index);
part.setParent(null);
}
/**
--- 594,604 ----
*/
public void removeBodyPart(int index) {
if (parts == null)
throw new IndexOutOfBoundsException("No such BodyPart");
! MimeBodyPart part = parts.get(index);
parts.remove(index);
part.setParent(null);
}
/**
*** 607,617 ****
*
* @param part The MimeBodyPart to be appended
*/
public synchronized void addBodyPart(MimeBodyPart part) {
if (parts == null)
! parts = new FinalArrayList();
parts.add(part);
part.setParent(this);
}
--- 607,617 ----
*
* @param part The MimeBodyPart to be appended
*/
public synchronized void addBodyPart(MimeBodyPart part) {
if (parts == null)
! parts = new FinalArrayList<MimeBodyPart>();
parts.add(part);
part.setParent(this);
}
*** 625,635 ****
* @param part The MimeBodyPart to be inserted
* @param index Location where to insert the part
*/
public synchronized void addBodyPart(MimeBodyPart part, int index) {
if (parts == null)
! parts = new FinalArrayList();
parts.add(index,part);
part.setParent(this);
}
--- 625,635 ----
* @param part The MimeBodyPart to be inserted
* @param index Location where to insert the part
*/
public synchronized void addBodyPart(MimeBodyPart part, int index) {
if (parts == null)
! parts = new FinalArrayList<MimeBodyPart>();
parts.add(index,part);
part.setParent(this);
}
< prev index next >