OlmStorage

Inheritance: java.lang.Object

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

public class OlmStorage implements System.IDisposable, Closeable

Represents Outlook for Mac storage (.OLM) file.

Constructors

Constructor Description
OlmStorage(TraversalExceptionsCallback callback) Initializes a new instance of the OlmStorage class.
OlmStorage(String fileName) Initializes a new instance of the OlmStorage class.
OlmStorage(InputStream stream) Initializes a new instance of the OlmStorage class.

Methods

Method Description
getFolderHierarchy() Gets the folder hierarchy.
load(InputStream stream) Load OLM storage from stream.
load(String fileName) Load OLM storage from file.
fromFile(String fileName) Load OLM storage from file.
fromStream(InputStream stream) Load OLM from stream.
getFolders() Gets collection of folders.
getFolder(String name, boolean ignoreCase) Gets the folder by name.
extractMapiMessage(OlmMessageInfo messageInfo) Get the message from OLM storage.
enumerateMessages(OlmFolder folder) Exposes the enumerator, which supports an iteration of messages in folder.
dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
close()

OlmStorage(TraversalExceptionsCallback callback)

public OlmStorage(TraversalExceptionsCallback callback)

Initializes a new instance of the OlmStorage class. Allows setting a callback method for handling exceptions that occur during OLM storage traversal.

Parameters:

Parameter Type Description
callback TraversalExceptionsCallback The exception callback.

OlmStorage(String fileName)

public OlmStorage(String fileName)

Initializes a new instance of the OlmStorage class.

Parameters:

Parameter Type Description
fileName java.lang.String OLM file name.

OlmStorage(InputStream stream)

public OlmStorage(InputStream stream)

Initializes a new instance of the OlmStorage class.

Parameters:

Parameter Type Description
stream java.io.InputStream Source stream java.io.InputStream with OLM storage data.

getFolderHierarchy()

public final List<OlmFolder> getFolderHierarchy()

Gets the folder hierarchy.

Value: The folder hierarchy.

Returns: java.util.List<com.aspose.email.OlmFolder>

load(InputStream stream)

public final boolean load(InputStream stream)

Load OLM storage from stream. This method is used when a OlmStorage object is created using constructor with the TraversalExceptionsCallback parameter.

Parameters:

Parameter Type Description
stream java.io.InputStream The stream.

Returns: boolean - ’true’ if the file has been loaded successfully and further traversal is possible; otherwise, false.

load(String fileName)

public final boolean load(String fileName)

Load OLM storage from file. This method is used when a OlmStorage object is created using constructor with the TraversalExceptionsCallback parameter.

Parameters:

Parameter Type Description
fileName java.lang.String The file name.

Returns: boolean - ’true’ if the file has been loaded successfully and further traversal is possible; otherwise, false.

fromFile(String fileName)

public static OlmStorage fromFile(String fileName)

Load OLM storage from file.

Parameters:

Parameter Type Description
fileName java.lang.String Name of .olm file.

Returns: OlmStorage - An OlmStorage object that represents the current OLM file.

fromStream(InputStream stream)

public static OlmStorage fromStream(InputStream stream)

Load OLM from stream.

Parameters:

Parameter Type Description
stream java.io.InputStream The System.IO.Stream.

Returns: OlmStorage - An OlmStorage object that represents the current OLM storage.

getFolders()

public final List<OlmFolder> getFolders()

Gets collection of folders.

Returns: java.util.List<com.aspose.email.OlmFolder> - The collection of folders that belong to the storage, i.e. the sub-folders of the current OLMStorage object.

getFolder(String name, boolean ignoreCase)

public final OlmFolder getFolder(String name, boolean ignoreCase)

Gets the folder by name.

Parameters:

Parameter Type Description
name java.lang.String Name of folder.
ignoreCase boolean A value that indicates whether the name to match is case insensitive.

Returns: OlmFolder - An OlmFolder object.

extractMapiMessage(OlmMessageInfo messageInfo)

public final MapiMessage extractMapiMessage(OlmMessageInfo messageInfo)

Get the message from OLM storage.

Parameters:

Parameter Type Description
messageInfo OlmMessageInfo An OlmMessageInfo object that represents information about message.

Returns: MapiMessage - A MapiMessage object.

enumerateMessages(OlmFolder folder)

public final System.Collections.Generic.IGenericEnumerable<MapiMessage> enumerateMessages(OlmFolder folder)

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

Parameters:

Parameter Type Description
folder OlmFolder OlmFolder that represents information about folder in OLM storage.

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

dispose()

public final void dispose()

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

close()

public void close()