public class BodyPartIterator extends MultipartIterator implements java.util.Iterator<javax.mail.internet.MimeBodyPart>
MimeBodyPart
.Modifier and Type | Class and Description |
---|---|
protected class |
BodyPartIterator.MimePartHolder |
MultipartIterator.KeyedByContentId
dataSource, idGenerator, log
Modifier | Constructor and Description |
---|---|
|
BodyPartIterator(byte[] bytes)
Constructor.
|
protected |
BodyPartIterator(javax.activation.DataSource ds) |
|
BodyPartIterator(java.io.InputStream in)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
javax.mail.internet.MimeBodyPart |
getBodyPart(int partNumber) |
javax.mail.internet.MimeBodyPart |
getBodyPart(java.lang.String id) |
boolean |
hasNext() |
protected void |
initIterator() |
javax.mail.internet.MimeBodyPart |
next() |
int |
size()
Return the number of body parts in this mime multipart.
|
getContentType, getHeaders, getMessageID, remove
public BodyPartIterator(java.io.InputStream in) throws java.io.IOException, javax.mail.MessagingException
in
- the Inputstream from which to parse the mime multi-partjavax.mail.MessagingException
- if the bytes did not contain a valid
MimeMultiPartjava.io.IOException
- if there was an IOExceptionjavax.mail.MessagingException
- if an underlying javax.mail exception occurredpublic BodyPartIterator(byte[] bytes) throws java.io.IOException, javax.mail.MessagingException
bytes
- the byte array where the mime multi-part is.javax.mail.MessagingException
- if the bytes did not contain a valid
MimeMultiPartjava.io.IOException
- if there was an IOExceptionjavax.mail.MessagingException
- if the bytes did not contain a valid
MimeMultiPartprotected BodyPartIterator(javax.activation.DataSource ds) throws java.io.IOException, javax.mail.MessagingException
java.io.IOException
javax.mail.MessagingException
public javax.mail.internet.MimeBodyPart getBodyPart(java.lang.String id)
public javax.mail.internet.MimeBodyPart getBodyPart(int partNumber)
public boolean hasNext()
hasNext
in interface java.util.Iterator<javax.mail.internet.MimeBodyPart>
public javax.mail.internet.MimeBodyPart next()
next
in interface java.util.Iterator<javax.mail.internet.MimeBodyPart>
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public int size()
protected void initIterator() throws javax.mail.MessagingException, java.io.IOException
initIterator
in class MultipartIterator
javax.mail.MessagingException
java.io.IOException