1 21 22 27 28 package com.sun.mail.imap; 29 30 import java.io.InputStream ; 31 import java.io.IOException ; 32 import java.util.Vector ; 33 34 import javax.mail.*; 35 import javax.mail.internet.*; 36 37 import com.sun.mail.util.*; 38 import com.sun.mail.iap.*; 39 import com.sun.mail.imap.protocol.*; 40 41 47 48 public class IMAPMultipartDataSource extends MimePartDataSource 49 implements MultipartDataSource { 50 private Vector parts; 51 52 protected IMAPMultipartDataSource(MimePart part, BODYSTRUCTURE[] bs, 53 String sectionId, IMAPMessage msg) { 54 super(part); 55 56 parts = new Vector (bs.length); 57 for (int i = 0; i < bs.length; i++) 58 parts.addElement( 59 new IMAPBodyPart(bs[i], 60 sectionId == null ? 61 Integer.toString(i+1) : 62 sectionId + "." + Integer.toString(i+1), 63 msg) 64 ); 65 } 66 67 public int getCount() { 68 return parts.size(); 69 } 70 71 public BodyPart getBodyPart(int index) throws MessagingException { 72 return (BodyPart)parts.elementAt(index); 73 } 74 } 75 | Popular Tags |