Class IterateOverMbox
- java.lang.Object
-
- org.apache.james.mime4j.samples.mbox.IterateOverMbox
-
public class IterateOverMbox extends java.lang.Object
Simple example of how to use Apache Mime4j Mbox Iterator. We split one mbox file file into individual email messages.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.nio.charset.CharsetEncoder
ENCODER
-
Constructor Summary
Constructors Constructor Description IterateOverMbox()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
private static java.lang.String
messageSummary(java.io.InputStream messageBytes)
Parse a message and return a simpleString
representation of some important fields.private static java.lang.String
retrieveMBoxFileName(java.lang.String[] args)
private static void
saveMessageToFile(int count, java.nio.CharBuffer buf)
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
retrieveMBoxFileName
private static java.lang.String retrieveMBoxFileName(java.lang.String[] args)
-
saveMessageToFile
private static void saveMessageToFile(int count, java.nio.CharBuffer buf) throws java.io.IOException
- Throws:
java.io.IOException
-
messageSummary
private static java.lang.String messageSummary(java.io.InputStream messageBytes) throws java.io.IOException, MimeException
Parse a message and return a simpleString
representation of some important fields.- Parameters:
messageBytes
- the message asInputStream
- Returns:
- String
- Throws:
java.io.IOException
MimeException
-
-