com.pff
Class PSTObject

java.lang.Object
  extended by com.pff.PSTObject
Direct Known Subclasses:
PSTAttachment, PSTFolder, PSTMessage, PSTMessageStore

public class PSTObject
extends java.lang.Object

PST Object is the root class of all PST Items. It also provides a number of static utility functions. The most important of which is the detectAndLoadPSTObject call which allows extraction of a PST Item from the file.


Field Summary
protected  java.util.LinkedHashMap<java.lang.String,java.util.HashMap<DescriptorIndexNode,PSTObject>> children
           
protected  byte[] data
           
protected  DescriptorIndexNode descriptorIndexNode
           
protected  java.util.HashMap<java.lang.Integer,com.pff.PSTTableBCItem> items
           
protected  java.util.HashMap<java.lang.Integer,com.pff.PSTDescriptorItem> localDescriptorItems
           
static int NID_TYPE_ASSOC_CONTENTS_TABLE
           
static int NID_TYPE_ASSOC_MESSAGE
           
static int NID_TYPE_ATTACHMENT
           
static int NID_TYPE_ATTACHMENT_TABLE
           
static int NID_TYPE_CONTENTS_TABLE
           
static int NID_TYPE_CONTENTS_TABLE_INDEX
           
static int NID_TYPE_HID
           
static int NID_TYPE_HIERARCHY_TABLE
           
static int NID_TYPE_INTERNAL
           
static int NID_TYPE_LTP
           
static int NID_TYPE_NORMAL_FOLDER
           
static int NID_TYPE_NORMAL_MESSAGE
           
static int NID_TYPE_OUTGOING_QUEUE_TABLE
           
static int NID_TYPE_RECEIVE_FOLDER_TABLE
           
static int NID_TYPE_RECIPIENT_TABLE
           
static int NID_TYPE_SEARCH_CONTENTS_TABLE
           
static int NID_TYPE_SEARCH_CRITERIA_OBJECT
           
static int NID_TYPE_SEARCH_FOLDER
           
static int NID_TYPE_SEARCH_TABLE_INDEX
           
static int NID_TYPE_SEARCH_UPDATE_QUEUE
           
protected  PSTFile pstFile
           
protected  com.pff.PSTTableBC table
           
 
Constructor Summary
protected PSTObject(PSTFile theFile, DescriptorIndexNode descriptorIndexNode)
           
protected PSTObject(PSTFile theFile, DescriptorIndexNode folderIndexNode, com.pff.PSTTableBC table, java.util.HashMap<java.lang.Integer,com.pff.PSTDescriptorItem> localDescriptorItems)
          for pre-population
 
Method Summary
static java.util.Calendar apptTimeToCalendar(int minutes)
           
static java.util.Calendar apptTimeToUTC(int minutes, PSTTimeZone tz)
           
static long convertBigEndianBytesToLong(byte[] data, int start, int end)
          Utility function for converting big endian bytes into a usable java long
static long convertLittleEndianBytesToLong(byte[] data)
          Utility function for converting little endian bytes into a usable java long
static long convertLittleEndianBytesToLong(byte[] data, int start, int end)
          Utility function for converting little endian bytes into a usable java long
protected static byte[] decode(byte[] data)
          decode a lump of data that has been encrypted with the compressible encryption
static PSTObject detectAndLoadPSTObject(PSTFile theFile, long descriptorIndex)
          Detect and load a PST Object from a file with the specified descriptor index
protected static byte[] encode(byte[] data)
           
protected static java.util.Date filetimeToDate(int high, int low)
          Converts a Windows FILETIME into a Date.
 java.lang.String getAddrType()
          Address type Known values are SMTP, EX (Exchange) and UNKNOWN
protected  byte[] getBinaryItem(int identifier)
           
protected  boolean getBooleanItem(int identifier)
           
protected  boolean getBooleanItem(int identifier, boolean defaultValue)
           
 java.lang.String getComment()
          Comment
 java.util.Date getCreationTime()
          Creation time
 java.util.Date getDateItem(int identifier)
           
 DescriptorIndexNode getDescriptorNode()
          get the descriptor node for this item this identifies the location of the node in the BTree and associated info
 long getDescriptorNodeId()
          get the descriptor identifier for this item can be used for loading objects through detectAndLoadPSTObject(PSTFile theFile, long descriptorIndex)
 java.lang.String getDisplayName()
          get the display name
protected  double getDoubleItem(int identifier)
           
protected  double getDoubleItem(int identifier, double defaultValue)
           
 java.lang.String getEmailAddress()
          E-mail address
protected  int getIntItem(int identifier)
           
protected  int getIntItem(int identifier, int defaultValue)
           
 java.lang.String getItemsString()
           
 java.util.Date getLastModificationTime()
          Modification time
protected  long getLongItem(int identifier)
           
protected  long getLongItem(int identifier, long defaultValue)
           
 java.lang.String getMessageClass()
           
 int getNodeType()
           
static int getNodeType(int descriptorIdentifier)
           
protected  java.lang.String getStringItem(int identifier)
           
protected  java.lang.String getStringItem(int identifier, int stringType)
           
protected  java.lang.String getStringItem(int identifier, int stringType, java.lang.String codepage)
           
protected  PSTTimeZone getTimeZoneItem(int identifier)
           
static void printHexFormatted(byte[] data, boolean pretty)
          Output a dump of data in hex format in the order it was read in
protected static void printHexFormatted(byte[] data, boolean pretty, int[] indexes)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NID_TYPE_HID

public static final int NID_TYPE_HID
See Also:
Constant Field Values

NID_TYPE_INTERNAL

public static final int NID_TYPE_INTERNAL
See Also:
Constant Field Values

NID_TYPE_NORMAL_FOLDER

public static final int NID_TYPE_NORMAL_FOLDER
See Also:
Constant Field Values

NID_TYPE_SEARCH_FOLDER

public static final int NID_TYPE_SEARCH_FOLDER
See Also:
Constant Field Values

NID_TYPE_NORMAL_MESSAGE

public static final int NID_TYPE_NORMAL_MESSAGE
See Also:
Constant Field Values

NID_TYPE_ATTACHMENT

public static final int NID_TYPE_ATTACHMENT
See Also:
Constant Field Values

NID_TYPE_SEARCH_UPDATE_QUEUE

public static final int NID_TYPE_SEARCH_UPDATE_QUEUE
See Also:
Constant Field Values

NID_TYPE_SEARCH_CRITERIA_OBJECT

public static final int NID_TYPE_SEARCH_CRITERIA_OBJECT
See Also:
Constant Field Values

NID_TYPE_ASSOC_MESSAGE

public static final int NID_TYPE_ASSOC_MESSAGE
See Also:
Constant Field Values

NID_TYPE_CONTENTS_TABLE_INDEX

public static final int NID_TYPE_CONTENTS_TABLE_INDEX
See Also:
Constant Field Values

NID_TYPE_RECEIVE_FOLDER_TABLE

public static final int NID_TYPE_RECEIVE_FOLDER_TABLE
See Also:
Constant Field Values

NID_TYPE_OUTGOING_QUEUE_TABLE

public static final int NID_TYPE_OUTGOING_QUEUE_TABLE
See Also:
Constant Field Values

NID_TYPE_HIERARCHY_TABLE

public static final int NID_TYPE_HIERARCHY_TABLE
See Also:
Constant Field Values

NID_TYPE_CONTENTS_TABLE

public static final int NID_TYPE_CONTENTS_TABLE
See Also:
Constant Field Values

NID_TYPE_ASSOC_CONTENTS_TABLE

public static final int NID_TYPE_ASSOC_CONTENTS_TABLE
See Also:
Constant Field Values

NID_TYPE_SEARCH_CONTENTS_TABLE

public static final int NID_TYPE_SEARCH_CONTENTS_TABLE
See Also:
Constant Field Values

NID_TYPE_ATTACHMENT_TABLE

public static final int NID_TYPE_ATTACHMENT_TABLE
See Also:
Constant Field Values

NID_TYPE_RECIPIENT_TABLE

public static final int NID_TYPE_RECIPIENT_TABLE
See Also:
Constant Field Values

NID_TYPE_SEARCH_TABLE_INDEX

public static final int NID_TYPE_SEARCH_TABLE_INDEX
See Also:
Constant Field Values

NID_TYPE_LTP

public static final int NID_TYPE_LTP
See Also:
Constant Field Values

pstFile

protected PSTFile pstFile

data

protected byte[] data

descriptorIndexNode

protected DescriptorIndexNode descriptorIndexNode

items

protected java.util.HashMap<java.lang.Integer,com.pff.PSTTableBCItem> items

localDescriptorItems

protected java.util.HashMap<java.lang.Integer,com.pff.PSTDescriptorItem> localDescriptorItems

children

protected java.util.LinkedHashMap<java.lang.String,java.util.HashMap<DescriptorIndexNode,PSTObject>> children

table

protected com.pff.PSTTableBC table
Constructor Detail

PSTObject

protected PSTObject(PSTFile theFile,
                    DescriptorIndexNode descriptorIndexNode)
             throws PSTException,
                    java.io.IOException
Throws:
PSTException
java.io.IOException

PSTObject

protected PSTObject(PSTFile theFile,
                    DescriptorIndexNode folderIndexNode,
                    com.pff.PSTTableBC table,
                    java.util.HashMap<java.lang.Integer,com.pff.PSTDescriptorItem> localDescriptorItems)
for pre-population

Parameters:
theFile -
folderIndexNode -
table -
Method Detail

getItemsString

public java.lang.String getItemsString()

getDescriptorNode

public DescriptorIndexNode getDescriptorNode()
get the descriptor node for this item this identifies the location of the node in the BTree and associated info

Returns:
item's descriptor node

getDescriptorNodeId

public long getDescriptorNodeId()
get the descriptor identifier for this item can be used for loading objects through detectAndLoadPSTObject(PSTFile theFile, long descriptorIndex)

Returns:
item's descriptor node identifier

getNodeType

public int getNodeType()

getNodeType

public static int getNodeType(int descriptorIdentifier)

getIntItem

protected int getIntItem(int identifier)

getIntItem

protected int getIntItem(int identifier,
                         int defaultValue)

getBooleanItem

protected boolean getBooleanItem(int identifier)

getBooleanItem

protected boolean getBooleanItem(int identifier,
                                 boolean defaultValue)

getDoubleItem

protected double getDoubleItem(int identifier)

getDoubleItem

protected double getDoubleItem(int identifier,
                               double defaultValue)

getLongItem

protected long getLongItem(int identifier)

getLongItem

protected long getLongItem(int identifier,
                           long defaultValue)

getStringItem

protected java.lang.String getStringItem(int identifier)

getStringItem

protected java.lang.String getStringItem(int identifier,
                                         int stringType)

getStringItem

protected java.lang.String getStringItem(int identifier,
                                         int stringType,
                                         java.lang.String codepage)

getDateItem

public java.util.Date getDateItem(int identifier)

getBinaryItem

protected byte[] getBinaryItem(int identifier)

getTimeZoneItem

protected PSTTimeZone getTimeZoneItem(int identifier)

getMessageClass

public java.lang.String getMessageClass()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDisplayName

public java.lang.String getDisplayName()
get the display name


getAddrType

public java.lang.String getAddrType()
Address type Known values are SMTP, EX (Exchange) and UNKNOWN


getEmailAddress

public java.lang.String getEmailAddress()
E-mail address


getComment

public java.lang.String getComment()
Comment


getCreationTime

public java.util.Date getCreationTime()
Creation time


getLastModificationTime

public java.util.Date getLastModificationTime()
Modification time


printHexFormatted

public static void printHexFormatted(byte[] data,
                                     boolean pretty)
Output a dump of data in hex format in the order it was read in

Parameters:
data -
pretty -

printHexFormatted

protected static void printHexFormatted(byte[] data,
                                        boolean pretty,
                                        int[] indexes)

decode

protected static byte[] decode(byte[] data)
decode a lump of data that has been encrypted with the compressible encryption

Parameters:
data -
Returns:
decoded data

encode

protected static byte[] encode(byte[] data)

convertLittleEndianBytesToLong

public static long convertLittleEndianBytesToLong(byte[] data)
Utility function for converting little endian bytes into a usable java long

Parameters:
data -
Returns:
long version of the data

convertLittleEndianBytesToLong

public static long convertLittleEndianBytesToLong(byte[] data,
                                                  int start,
                                                  int end)
Utility function for converting little endian bytes into a usable java long

Parameters:
data -
start -
end -
Returns:
long version of the data

convertBigEndianBytesToLong

public static long convertBigEndianBytesToLong(byte[] data,
                                               int start,
                                               int end)
Utility function for converting big endian bytes into a usable java long

Parameters:
data -
start -
end -
Returns:
long version of the data

detectAndLoadPSTObject

public static PSTObject detectAndLoadPSTObject(PSTFile theFile,
                                               long descriptorIndex)
                                        throws java.io.IOException,
                                               PSTException
Detect and load a PST Object from a file with the specified descriptor index

Parameters:
theFile -
descriptorIndex -
Returns:
PSTObject with that index
Throws:
java.io.IOException
PSTException

filetimeToDate

protected static java.util.Date filetimeToDate(int high,
                                               int low)

Converts a Windows FILETIME into a Date. The Windows FILETIME structure holds a date and time associated with a file. The structure identifies a 64-bit integer specifying the number of 100-nanosecond intervals which have passed since January 1, 1601. This 64-bit value is split into the two double words stored in the structure.

Parameters:
high - The higher double word of the FILETIME structure.
low - The lower double word of the FILETIME structure.
Returns:
The Windows FILETIME as a Date.

apptTimeToCalendar

public static java.util.Calendar apptTimeToCalendar(int minutes)

apptTimeToUTC

public static java.util.Calendar apptTimeToUTC(int minutes,
                                               PSTTimeZone tz)