MboxStorageReader

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IDisposable, java.io.Closeable

public abstract class MboxStorageReader implements System.IDisposable, Closeable

A base class for any mbox-based mail storage reader.

Methods

Method Description
getCurrentDataSize() Gets the number of bytes that is read by ReadNextMessage method.
createReader(InputStream stream, boolean leaveOpen) Creates the instance of reader.
createReader(System.IO.Stream stream, boolean leaveOpen) Creates the instance of reader.
createReader(InputStream stream, MboxLoadOptions options) Creates the instance of reader.
createReader(System.IO.Stream stream, MboxLoadOptions options) Creates the instance of reader.
createReader(String fileName, boolean leaveOpen) Creates the instance of reader.
createReader(String fileName, MboxLoadOptions options) Creates the instance of reader.
enumerateMessages() Exposes the enumerator, which supports an iteration of messages in storage.
enumerateMessages(EmlLoadOptions options) Exposes the enumerator, which supports an iteration of messages in storage.
readNextMessage() Reads the next message from underlying storage stream.
readNextMessage(String[] fromMarker) Reads the next message from underlying storage stream.
readNextMessage(EmlLoadOptions options) Reads the next message from underlying storage stream.
readNextMessage(String[] fromMarker, EmlLoadOptions options) Reads the next message from underlying storage stream.
getTotalItemsCount() Returns the number of messages in a storage.
dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
close()

getCurrentDataSize()

public final long getCurrentDataSize()

Gets the number of bytes that is read by ReadNextMessage method.

Returns: long

createReader(InputStream stream, boolean leaveOpen)

public static MboxStorageReader createReader(InputStream stream, boolean leaveOpen)

Creates the instance of reader.

Parameters:

Parameter Type Description
stream java.io.InputStream The stream.
leaveOpen boolean if set to ``` true ``` leaves the underlying stream open after disposing.

Returns: MboxStorageReader -

createReader(System.IO.Stream stream, boolean leaveOpen)

public static MboxStorageReader createReader(System.IO.Stream stream, boolean leaveOpen)

Creates the instance of reader.

Parameters:

Parameter Type Description
stream com.aspose.ms.System.IO.Stream The stream.
leaveOpen boolean if set to ``` true ``` leaves the underlying stream open after disposing.

Returns: MboxStorageReader -

createReader(InputStream stream, MboxLoadOptions options)

public static MboxStorageReader createReader(InputStream stream, MboxLoadOptions options)

Creates the instance of reader.

Parameters:

Parameter Type Description
stream java.io.InputStream The stream.
options MboxLoadOptions additional options when loading a Mbox storageMboxLoadOptions.

Returns: MboxStorageReader -

createReader(System.IO.Stream stream, MboxLoadOptions options)

public static MboxStorageReader createReader(System.IO.Stream stream, MboxLoadOptions options)

Creates the instance of reader.

Parameters:

Parameter Type Description
stream com.aspose.ms.System.IO.Stream The stream.
options MboxLoadOptions additional options when loading a Mbox storageMboxLoadOptions.

Returns: MboxStorageReader -

createReader(String fileName, boolean leaveOpen)

public static MboxStorageReader createReader(String fileName, boolean leaveOpen)

Creates the instance of reader.

Parameters:

Parameter Type Description
fileName java.lang.String
leaveOpen boolean

Returns: MboxStorageReader -

createReader(String fileName, MboxLoadOptions options)

public static MboxStorageReader createReader(String fileName, MboxLoadOptions options)

Creates the instance of reader.

Parameters:

Parameter Type Description
fileName java.lang.String
options MboxLoadOptions additional options when loading a Mbox storageMboxLoadOptions.

Returns: MboxStorageReader -

enumerateMessages()

public final System.Collections.Generic.IGenericEnumerable<MailMessage> enumerateMessages()

Exposes the enumerator, which supports an iteration of messages in storage.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.email.MailMessage> - ``` System.Collections.Generic.IEnumerableltTgt ```, that represents an enumerator that iterates through a messages in storage.

enumerateMessages(EmlLoadOptions options)

public final System.Collections.Generic.IGenericEnumerable<MailMessage> enumerateMessages(EmlLoadOptions options)

Exposes the enumerator, which supports an iteration of messages in storage.

Parameters:

Parameter Type Description
options EmlLoadOptions Specifies EmlLoadOptions when reading message from Mbox storage.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.email.MailMessage> - ``` System.Collections.Generic.IEnumerableltTgt ```, that represents an enumerator that iterates through a messages in storage.

readNextMessage()

public abstract MailMessage readNextMessage()

Reads the next message from underlying storage stream.

Returns: MailMessage - A MailMessage object if it can be read or ``` null ``` if no more messages are available.

readNextMessage(String[] fromMarker)

public abstract MailMessage readNextMessage(String[] fromMarker)

Reads the next message from underlying storage stream.

Parameters:

Parameter Type Description
fromMarker java.lang.String[] Gets the From Marker while parsing the MBox Storage file.

Returns: MailMessage - A MailMessage object if it can be read or ``` null ``` if no more messages are available.

readNextMessage(EmlLoadOptions options)

public abstract MailMessage readNextMessage(EmlLoadOptions options)

Reads the next message from underlying storage stream.

Parameters:

Parameter Type Description
options EmlLoadOptions Specifies EmlLoadOptions when reading message from Mbox storage.

Returns: MailMessage - A MailMessage object if it can be read or ``` null ``` if no more messages are available.

readNextMessage(String[] fromMarker, EmlLoadOptions options)

public abstract MailMessage readNextMessage(String[] fromMarker, EmlLoadOptions options)

Reads the next message from underlying storage stream.

Parameters:

Parameter Type Description
fromMarker java.lang.String[] Gets the From Marker while parsing the MBox Storage file.
options EmlLoadOptions Specifies EmlLoadOptions when reading message from Mbox storage.

Returns: MailMessage - A MailMessage object if it can be read or ``` null ``` if no more messages are available.

getTotalItemsCount()

public abstract int getTotalItemsCount()

Returns the number of messages in a storage.

Returns: int - Returns the number of messages in a storage.

dispose()

public final void dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

close()

public void close()