Package com.pff
Class PSTFile
java.lang.Object
com.pff.PSTFile
PSTFile is the containing class that allows you to access items within a .pst file.
Start here, get the root of the folders and work your way down through your items.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanprivate static booleanprivate LinkedHashMap<Integer, LinkedList<DescriptorIndexNode>> static final intstatic final intprivate intprivate byte[]private static final String[]private RandomAccessFileprivate intprivate static final intprivate static Propertiesprivate static Propertiesstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprotected static final intstatic final intprivate intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longextractLEFileOffset(long startOffset) Read a file offset from the file PST Files have this tendency to store file offsets (pointers) in 8 little endian bytes.protected voidfinalize()destructor just closes the file handle...private byte[]findBtreeItem(RandomAccessFile in, long index, boolean descTree) Generic function used by getOffsetIndexNode and getDescriptorIndexNode for navigating the PST B-Trees(package private) LinkedHashMap<Integer, LinkedList<DescriptorIndexNode>> Build the children descriptor tree This goes through the entire descriptor B-Tree and adds every item to the childrenDescriptorTree.private byte[]getData(PSTTableItem item, HashMap<Integer, PSTDescriptorItem> localDescriptorItems) (package private) DescriptorIndexNodegetDescriptorIndexNode(long identifier) navigate the internal descriptor B-Tree and find a specific itemintget the type of encryption the file usesget the handle to the file we are currently accessing(package private) static StringgetInternetCodePageCharset(int propertyId) intgetLeafSize(long bid) get the message store of the PST file.(package private) intgetNameToIdMapItem(int key, int propertySetIndex) (package private) static longgetNameToIdMapKey(int id) (package private) OffsetIndexItemgetOffsetIndexNode(long identifier) navigate the internal index B-Tree and find a specific item(package private) static StringgetPropertyDescription(int entryType, int entryValueType) (package private) static StringgetPropertyName(int propertyId, boolean bNamed) (package private) HashMap<Integer, PSTDescriptorItem> getPSTDescriptorItems(long localDescriptorsOffsetIndexIdentifier) parse a PSTDescriptor and get all of its items(package private) HashMap<Integer, PSTDescriptorItem> int(package private) intget the root folder for the PST file.private voidprocessDescriptorBTree(long btreeStartOffset) Recursive function for building the descriptor tree, used by buildDescriptorTreeprivate voidread the name-to-id map from the file and load it in(package private) PSTNodeInputStreamreadLeaf(long bid)
-
Field Details
-
ENCRYPTION_TYPE_NONE
public static final int ENCRYPTION_TYPE_NONE- See Also:
-
ENCRYPTION_TYPE_COMPRESSIBLE
public static final int ENCRYPTION_TYPE_COMPRESSIBLE- See Also:
-
MESSAGE_STORE_DESCRIPTOR_IDENTIFIER
private static final int MESSAGE_STORE_DESCRIPTOR_IDENTIFIER- See Also:
-
ROOT_FOLDER_DESCRIPTOR_IDENTIFIER
private static final int ROOT_FOLDER_DESCRIPTOR_IDENTIFIER- See Also:
-
PST_TYPE_ANSI
public static final int PST_TYPE_ANSI- See Also:
-
PST_TYPE_ANSI_2
protected static final int PST_TYPE_ANSI_2- See Also:
-
PST_TYPE_UNICODE
public static final int PST_TYPE_UNICODE- See Also:
-
PS_PUBLIC_STRINGS
public static final int PS_PUBLIC_STRINGS- See Also:
-
PSETID_Common
public static final int PSETID_Common- See Also:
-
PSETID_Address
public static final int PSETID_Address- See Also:
-
PS_INTERNET_HEADERS
public static final int PS_INTERNET_HEADERS- See Also:
-
PSETID_Appointment
public static final int PSETID_Appointment- See Also:
-
PSETID_Meeting
public static final int PSETID_Meeting- See Also:
-
PSETID_Log
public static final int PSETID_Log- See Also:
-
PSETID_Messaging
public static final int PSETID_Messaging- See Also:
-
PSETID_Note
public static final int PSETID_Note- See Also:
-
PSETID_PostRss
public static final int PSETID_PostRss- See Also:
-
PSETID_Task
public static final int PSETID_Task- See Also:
-
PSETID_UnifiedMessaging
public static final int PSETID_UnifiedMessaging- See Also:
-
PS_MAPI
public static final int PS_MAPI- See Also:
-
PSETID_AirSync
public static final int PSETID_AirSync- See Also:
-
PSETID_Sharing
public static final int PSETID_Sharing- See Also:
-
guidStrings
-
guidMap
-
encryptionType
private int encryptionType -
childrenDescriptorTree
-
nameToId
-
stringToId
-
idToName
-
idToString
-
guids
private byte[] guids -
itemCount
private int itemCount -
in
-
pstFileType
private int pstFileType -
propertyInternetCodePages
-
bCPFirstTime
private static boolean bCPFirstTime -
propertyNames
-
bFirstTime
private static boolean bFirstTime
-
-
Constructor Details
-
PSTFile
constructor- Parameters:
fileName-- Throws:
FileNotFoundExceptionPSTExceptionIOException
-
PSTFile
-
-
Method Details
-
getPSTFileType
public int getPSTFileType() -
processNameToIdMap
read the name-to-id map from the file and load it in- Parameters:
in-- Throws:
IOExceptionPSTException
-
getData
private byte[] getData(PSTTableItem item, HashMap<Integer, PSTDescriptorItem> localDescriptorItems) throws IOException, PSTException- Throws:
IOExceptionPSTException
-
getNameToIdMapItem
int getNameToIdMapItem(int key, int propertySetIndex) -
getPublicStringToIdMapItem
-
getNameToIdMapKey
static long getNameToIdMapKey(int id) -
getInternetCodePageCharset
-
getPropertyName
-
getPropertyDescription
-
finalize
destructor just closes the file handle...- Overrides:
finalizein classObject- Throws:
IOException
-
getEncryptionType
public int getEncryptionType()get the type of encryption the file uses- Returns:
- encryption type used in the PST File
-
getFileHandle
get the handle to the file we are currently accessing -
getMessageStore
get the message store of the PST file. Note that this doesn't really have much information, better to look under the root folder- Throws:
PSTExceptionIOException
-
getRootFolder
get the root folder for the PST file. You should find all of your data under here...- Throws:
PSTExceptionIOException
-
readLeaf
- Throws:
IOExceptionPSTException
-
getLeafSize
- Throws:
IOExceptionPSTException
-
extractLEFileOffset
Read a file offset from the file PST Files have this tendency to store file offsets (pointers) in 8 little endian bytes. Convert this to a long for seeking to.- Parameters:
startOffset- where to read the 8 bytes fromin- handle for PST file- Returns:
- long representing the read location
- Throws:
IOException
-
findBtreeItem
private byte[] findBtreeItem(RandomAccessFile in, long index, boolean descTree) throws IOException, PSTException Generic function used by getOffsetIndexNode and getDescriptorIndexNode for navigating the PST B-Trees- Parameters:
in-index-descTree-- Returns:
- Throws:
IOExceptionPSTException
-
getDescriptorIndexNode
navigate the internal descriptor B-Tree and find a specific item- Parameters:
identifier-in-- Returns:
- the descriptor node for the item
- Throws:
IOExceptionPSTException
-
getOffsetIndexNode
navigate the internal index B-Tree and find a specific item- Parameters:
identifier-in-- Returns:
- the offset index item
- Throws:
IOExceptionPSTException
-
getPSTDescriptorItems
HashMap<Integer,PSTDescriptorItem> getPSTDescriptorItems(long localDescriptorsOffsetIndexIdentifier) throws PSTException, IOException parse a PSTDescriptor and get all of its items- Throws:
PSTExceptionIOException
-
getPSTDescriptorItems
HashMap<Integer,PSTDescriptorItem> getPSTDescriptorItems(PSTNodeInputStream in) throws PSTException, IOException - Throws:
PSTExceptionIOException
-
getChildDescriptorTree
LinkedHashMap<Integer,LinkedList<DescriptorIndexNode>> getChildDescriptorTree() throws IOException, PSTExceptionBuild the children descriptor tree This goes through the entire descriptor B-Tree and adds every item to the childrenDescriptorTree. This is used as fallback when the nodes that list file contents are broken.- Parameters:
in-- Throws:
IOExceptionPSTException
-
processDescriptorBTree
Recursive function for building the descriptor tree, used by buildDescriptorTree- Parameters:
btreeStartOffset-in-- Throws:
IOExceptionPSTException
-