Class IterateOverMbox
- java.lang.Object
-
- org.apache.james.mime4j.samples.mbox.IterateOverMbox
-
public class IterateOverMbox extends java.lang.ObjectSimple 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.CharsetEncoderENCODER
-
Constructor Summary
Constructors Constructor Description IterateOverMbox()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)private static java.lang.StringmessageSummary(java.io.InputStream messageBytes)Parse a message and return a simpleStringrepresentation of some important fields.private static java.lang.StringretrieveMBoxFileName(java.lang.String[] args)private static voidsaveMessageToFile(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, MimeExceptionParse a message and return a simpleStringrepresentation of some important fields.- Parameters:
messageBytes- the message asInputStream- Returns:
- String
- Throws:
java.io.IOExceptionMimeException
-
-