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 class
MboxIterator.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
bufferDetailsToString(Buffer buffer)
Utility method to log important details about buffers.void
close()
static MboxIterator.Builder
fromFile(File filePath)
static MboxIterator.Builder
fromFile(String file)
static MboxIterator.Builder
fromFile(Path filePath)
protected void
initMboxIterator()
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 IOException
initialize the Mailbox iterator- Throws:
IOException
CharConversionException
-
iterator
public Iterator<CharBufferWrapper> iterator()
- Specified by:
iterator
in interfaceIterable<CharBufferWrapper>
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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)
-
-