public class OlmStorage extends Object implements IDisposable, Closeable
Represents Outlook for Mac storage (.OLM) file.
Constructor and Description |
---|
OlmStorage(InputStream stream)
Initializes a new instance of the
OlmStorage class. |
OlmStorage(String fileName)
Initializes a new instance of the
OlmStorage class. |
OlmStorage(TraversalExceptionsCallback callback)
Initializes a new instance of the
OlmStorage class. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
dispose()
Performs application-defined tasks associated with freeing,
releasing, or resetting unmanaged resources.
|
protected void |
dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources.
|
IGenericEnumerable<MapiMessage> |
enumerateMessages(OlmFolder folder)
Exposes the enumerator, which supports an iteration of messages in folder.
|
MapiMessage |
extractMapiMessage(OlmMessageInfo messageInfo)
Get the message from OLM storage.
|
static OlmStorage |
fromFile(String fileName)
Load OLM storage from file.
|
static OlmStorage |
fromStream(InputStream stream)
Load OLM from stream.
|
OlmFolder |
getFolder(String name,
boolean ignoreCase)
Gets the folder by name.
|
List<OlmFolder> |
getFolderHierarchy()
Gets the folder hierarchy.
|
List<OlmFolder> |
getFolders()
Gets collection of folders.
|
boolean |
load(InputStream stream)
Load OLM storage from stream.
|
boolean |
load(String fileName)
Load OLM storage from file.
|
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.
callback
- The exception callback.public OlmStorage(String fileName)
Initializes a new instance of the OlmStorage
class.
fileName
- OLM file name.ArgumentNullException
- throws if file name is null or emptypublic OlmStorage(InputStream stream)
Initializes a new instance of the OlmStorage
class.
stream
- Source stream InputStream
with OLM storage data.ArgumentNullException
- throws if stream is nullpublic final List<OlmFolder> getFolderHierarchy()
Gets the folder hierarchy.
Value: The folder hierarchy.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.
stream
- The stream.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.
fileName
- The file name.public static OlmStorage fromFile(String fileName)
Load OLM storage from file.
fileName
- Name of .olm file.public static OlmStorage fromStream(InputStream stream)
Load OLM from stream.
stream
- The System.IO.Stream.public final List<OlmFolder> getFolders()
Gets collection of folders.
public final OlmFolder getFolder(String name, boolean ignoreCase)
Gets the folder by name.
name
- Name of folder.ignoreCase
- A value that indicates whether the name to match is case insensitive.public final MapiMessage extractMapiMessage(OlmMessageInfo messageInfo)
Get the message from OLM storage.
messageInfo
- An OlmMessageInfo object that
represents information about message.public final IGenericEnumerable<MapiMessage> enumerateMessages(OlmFolder folder)
Exposes the enumerator, which supports an iteration of messages in folder.
folder
- OlmFolder
that represents information about folder in OLM storage.System.Collections.Generic.IEnumerableltTgt
,
that represents an enumerator that iterates through a messages in folder.ArgumentNullException
- throws if folder is nullpublic final void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose
in interface IDisposable
public void close()
close
in interface Closeable
close
in interface AutoCloseable
protected void dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources.
disposing
- true
to release both managed
and unmanaged resources; false
to release only unmanaged resources.Copyright (c) 2008-2022 Aspose Pty Ltd. All Rights Reserved.