Class MboxIterator
- java.lang.Object
-
- org.apache.james.mime4j.mboxiterator.MboxIterator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<CharBufferWrapper>
public class MboxIterator extends Object implements Iterable<CharBufferWrapper>, Closeable
Class that provides an iterator over email messages inside an mbox file. An mbox file is a sequence of email messages separated by From_ lines.
Description ot the file format:
- http://tools.ietf.org/html/rfc4155
- http://qmail.org/man/man5/mbox.html
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMboxIterator.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringbufferDetailsToString(Buffer buffer)Utility method to log important details about buffers.voidclose()static MboxIterator.BuilderfromFile(File filePath)static MboxIterator.BuilderfromFile(String file)static MboxIterator.BuilderfromFile(Path filePath)protected voidinitMboxIterator()initialize the Mailbox iteratorIterator<CharBufferWrapper>iterator()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
initMboxIterator
protected void initMboxIterator() throws IOExceptioninitialize the Mailbox iterator- Throws:
IOExceptionCharConversionException
-
iterator
public Iterator<CharBufferWrapper> iterator()
- Specified by:
iteratorin interfaceIterable<CharBufferWrapper>
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
fromFile
public static MboxIterator.Builder fromFile(Path filePath)
-
fromFile
public static MboxIterator.Builder fromFile(File filePath)
-
fromFile
public static MboxIterator.Builder fromFile(String file)
-
-