public class PersonalStorage extends Object implements com.aspose.email.ms.System.IDisposable
Represents Personal Storage Table (.pst) file.
Constructor and Description |
---|
PersonalStorage() |
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite()
Gets a value indicating whether
the current pst supports writing.
|
void |
changeDisplayName(String newName)
Changes the pst display name.
|
void |
convertTo(int format)
Converts the current object to the specified format.
|
static PersonalStorage |
create(OutputStream stream,
int version) |
static PersonalStorage |
create(String fileName,
int version)
Creates the new PST file with the specified file name.
|
FolderInfo |
createPredefinedFolder(String name,
int defaultFolder)
Creates the standard interpersonal message (IPM) folder.
|
void |
dispose()
Performs application-defined tasks associated with freeing,
releasing, or resetting unmanaged resources.
|
MapiMessage |
extractMessage(byte[] entryId)
Get the message from PST.
|
MapiMessage |
extractMessage(MessageInfo messageInfo)
Get the message from PST.
|
MapiMessage |
extractMessage(String entryId)
Get the message from PST.
|
MapiProperty |
extractProperty(byte[] entryId,
long tag)
Gets the specified property of item, without extract the item fully.
|
static PersonalStorage |
fromFile(String fileName)
Load PST from file.
|
static PersonalStorage |
fromFile(String fileName,
boolean writable)
Load PST from file.
|
static PersonalStorage |
fromStream(InputStream stream) |
static PersonalStorage |
fromStream(InputStream stream,
boolean writable) |
String |
getDisplayName()
Gets the display Name of PST.
|
FolderInfo |
getFolderById(byte[] entryId)
Gets the personal folder from PST.
|
FolderInfo |
getFolderById(String entryIdString)
Gets the personal folder from PST.
|
int |
getFormat()
Gets the file format.
|
MapiPropertyCollection |
getMessageStoreProperties()
Gets the MAPI properties of message store object.
|
FolderInfo |
getPredefinedFolder(int defaultFolder)
Gets the standard interpersonal message (IPM) folder from PST.
|
FolderInfo |
getRootFolder()
Gets the root folder of PST.
|
boolean |
isUnicode()
Gets a value indicating whether the PST file format is Unicode.
|
void |
saveAs(String fileName,
int format)
Saves the current object to a specified file format in a different file.
|
void |
saveMessageToFile(String entryId,
String fileName) |
void |
saveMessageToStream(String entryId,
OutputStream stream) |
public FolderInfo getRootFolder()
Gets the root folder of PST.
Value:FolderInfo
that represents a root folder.public String getDisplayName()
Gets the display Name of PST.
Value: The string that represents display name.public int getFormat()
Gets the file format.
Value:FileFormat
that specifies file format.
public boolean canWrite()
Gets a value indicating whether the current pst supports writing.
public MapiPropertyCollection getMessageStoreProperties()
Gets the MAPI properties of message store object. The message store contains the top-level PST settings and metadata that are required to access and manage the PST contents.
public boolean isUnicode()
Gets a value indicating whether the PST file format is Unicode. There are two versions of the PST file format: Unicode and ANSI.
public static PersonalStorage fromFile(String fileName)
Load PST from file.
fileName
- Name of .pst file.
public static PersonalStorage fromFile(String fileName, boolean writable)
Load PST from file.
fileName
- Name of .pst file.writable
- if set to true
then the the pst file will support writing,
otherwise it will be opened in read-only mode.public void saveAs(String fileName, int format)
Saves the current object to a specified file format in a different file.
fileName
- The name of the file to be saved.format
- The FileFormat
is to be used when saving a file.public static PersonalStorage fromStream(InputStream stream, boolean writable)
public static PersonalStorage fromStream(InputStream stream)
public static PersonalStorage create(String fileName, int version)
Creates the new PST file with the specified file name.
fileName
- The full name of the file.version
- The PST file version.
com.aspose.email.ms.System.NotImplementedException
- throws if ANSI file version is createdcom.aspose.email.ms.System.IllegalArgumentException
- throws if file name is null or emptypublic void convertTo(int format)
Converts the current object to the specified format.
format
- The FileFormat to convert the current object to.public static PersonalStorage create(OutputStream stream, int version)
public MapiMessage extractMessage(MessageInfo messageInfo)
Get the message from PST.
messageInfo
- A MessageInfo object that
represents information about message.public MapiMessage extractMessage(byte[] entryId)
Get the message from PST.
entryId
- EntryId of message.public MapiMessage extractMessage(String entryId)
Get the message from PST.
entryId
- String representation of EntryId.public void saveMessageToStream(String entryId, OutputStream stream)
public FolderInfo createPredefinedFolder(String name, int defaultFolder)
Creates the standard interpersonal message (IPM) folder.
name
- The name of folder.defaultFolder
- The value of StandardIpmFolder
enumeration.FolderInfo
object that represents a standard IPM folder.public FolderInfo getPredefinedFolder(int defaultFolder)
Gets the standard interpersonal message (IPM) folder from PST. Outlook can create a number of default folders, such as Outbox, Deleted Items, Sent Items etc.
defaultFolder
- The value of StandardIpmFolder
enumeration.FolderInfo
object that represents a standard IPM folder.public FolderInfo getFolderById(byte[] entryId)
Gets the personal folder from PST.
entryId
- The Entry id.public FolderInfo getFolderById(String entryIdString)
Gets the personal folder from PST.
entryIdString
- String representation of entry ID.public MapiProperty extractProperty(byte[] entryId, long tag)
Gets the specified property of item, without extract the item fully.
entryId
- The entry id of item.tag
- The property tag.
public void changeDisplayName(String newName)
Changes the pst display name.
newName
- The new display name of message store.public void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose
in interface com.aspose.email.ms.System.IDisposable
Copyright (c) 2008-2013 Aspose Pty Ltd. All Rights Reserved.