Package io.github.jmcleodfoss.pst
Class MessageStore
java.lang.Object
io.github.jmcleodfoss.pst.MessageStore
public class MessageStore extends Object
The MessageStore class is a (thin) wrapper around the message store PC, with a few convenience functions.
- See Also:
- "[MS-PST] Outlook Personal Folders (.pst) File Format v20110608, section 2.4.3", Message Store (MSDN)
-
Field Summary
Fields Modifier and Type Field Description EntryID
rootMailboxEntry
The root folder. -
Constructor Summary
Constructors Constructor Description MessageStore(io.github.jmcleodfoss.pst.BlockMap bbt, NodeMap nbt, PSTFile pstFile)
Create a message store object by reading in the message store node. -
Method Summary
Modifier and Type Method Description boolean
checkPassword(String testPassword)
Check whether the given password matches the stored password.boolean
hasPassword()
Determine whether this PST file requires a password.Folder
rootFolder()
Get the PST root folder, which contains all PST subfolders and messages.TableModel
tableModel(NameToIDMap namedProperties)
Obtain a javax.swing.table.TableModel describing the message store.
-
Field Details
-
rootMailboxEntry
The root folder.
-
-
Constructor Details
-
MessageStore
public MessageStore(io.github.jmcleodfoss.pst.BlockMap bbt, NodeMap nbt, PSTFile pstFile) throws NotHeapNodeException, NotPropertyContextNodeException, NullDataBlockException, UnknownClientSignatureException, UnparseablePropertyContextException, UnparseableTableContextException, IOExceptionCreate a message store object by reading in the message store node.- Parameters:
bbt
- The PST file's block B-tree.nbt
- The PST file's node B-tree.pstFile
- The PST file input data stream,header
, etc.- Throws:
NotHeapNodeException
- A node which was not a heap node was found while creating the message store.NotPropertyContextNodeException
- A node without the Property Context client signature was found while building a property context.NullDataBlockException
- A null data block was found while building a property context.UnknownClientSignatureException
- The client signature of one of the blocks in the message store was not recognized.UnparseablePropertyContextException
- The property context could not be interpreted.UnparseableTableContextException
- The table context could not be interpreted.IOException
- The PST file could not be read.
-
-
Method Details
-
checkPassword
Check whether the given password matches the stored password.- Parameters:
testPassword
- The password to check.- Returns:
- true if the passed password matches the password in the PST file, false otherwise.
- See Also:
passwordHashed
,hasPassword()
-
hasPassword
public boolean hasPassword()Determine whether this PST file requires a password.- Returns:
- true if the PST file is password-protected, false if it is not password-protected.
- See Also:
passwordHashed
,checkPassword(java.lang.String)
-
rootFolder
public Folder rootFolder() throws NotPropertyContextNodeException, NotTableContextNodeException, NullDataBlockException, NotHeapNodeException, UnknownClientSignatureException, UnparseablePropertyContextException, UnparseableTableContextException, IOExceptionGet the PST root folder, which contains all PST subfolders and messages.- Returns:
- The root folder of the PST file, as a Folder object.
- Throws:
NotPropertyContextNodeException
- A node without the Property Context client signature was found while building a property context.NotTableContextNodeException
- A node without the Table Context client signature was found while building a table context.NullDataBlockException
- A null data block was found while building a property context.NotHeapNodeException
- A node which was not a heap node was found while reading the root folder.UnknownClientSignatureException
- The client signature of one of the blocks in the root folder was not recognized.UnparseablePropertyContextException
- The property context could not be interpreted.UnparseableTableContextException
- The table context could not be interpreted.IOException
- The PST file could not be read.
-
tableModel
Obtain a javax.swing.table.TableModel describing the message store.- Parameters:
namedProperties
- The named properties for this PST file.- Returns:
- A javax.swing.tableTableModel containing the named properties.
-