Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.nntp.spi
Class MimeBodyPartIterator

java.lang.Object
  extended by com.jivesoftware.forum.nntp.spi.PeekIterator
      extended by com.jivesoftware.forum.nntp.spi.MimeBodyPartIterator
All Implemented Interfaces:
java.util.Iterator

public class MimeBodyPartIterator
extends PeekIterator

An iterator of MIME body parts, it scans an underlying Iterator of Strings comprising the RFC822 email message. Each call to next() forwards the underlying iterator to beginning of the next MIME body part and returns an iterator that will return the Strings making up just that body part. The MIME iterator continues to exhaust the message contents until it reaches the message body terminating '.'.


Constructor Summary
MimeBodyPartIterator(java.util.Iterator bodyIterator, java.lang.String boundaryMarker)
          Create an iterator using the given body iterator.
 
Method Summary
 boolean hasNext()
          Returns true if there is another body string left in this iterator.
 boolean hasNextBodyPart()
          Returns true if there is another body part following this one.
 java.lang.Object next()
          Return an iterator over the lines (String objects) of the next body part.
 
Methods inherited from class com.jivesoftware.forum.nntp.spi.PeekIterator
peek, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeBodyPartIterator

public MimeBodyPartIterator(java.util.Iterator bodyIterator,
                            java.lang.String boundaryMarker)
Create an iterator using the given body iterator. MIME boundaries will be matched to the given boundaryMarker and should be parsed from the Content-Type: multi-part/mixed; boundary="boundaryMarker" header.

Parameters:
bodyIterator - Iterator of the String lines making up the message body.
boundaryMarker - the MIME boundary marker used to detect body part divisions.
Method Detail

hasNext

public boolean hasNext()
Returns true if there is another body string left in this iterator.

Specified by:
hasNext in interface java.util.Iterator
Overrides:
hasNext in class PeekIterator
Returns:
true if there is another body string left in the iterator.

hasNextBodyPart

public boolean hasNextBodyPart()
Returns true if there is another body part following this one. This method is only valid if the call to hasNext() is false (the end of the current body part). Calling this method if hasNext() is not false will always return false.

Returns:
true if there is another body string left in the iterator.

next

public java.lang.Object next()
Return an iterator over the lines (String objects) of the next body part.

Specified by:
next in interface java.util.Iterator
Overrides:
next in class PeekIterator
Returns:
the next Iterator over the next body part lines.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.