Package com.pff
Class PSTFolder
- java.lang.Object
-
- com.pff.PSTObject
-
- com.pff.PSTFolder
-
public class PSTFolder extends PSTObject
Represents a folder in the PST File Allows you to access child folders or items. Items are accessed through a sort of cursor arrangement. This allows for incremental reading of a folder which may have _lots_ of emails.
-
-
Field Summary
Fields Modifier and Type Field Description private int
currentEmailIndex
internal vars for the tracking of things..private PSTTable7C
emailsTable
private java.util.LinkedList<DescriptorIndexNode>
fallbackEmailsTable
private java.util.LinkedHashSet<DescriptorIndexNode>
otherItems
private PSTTable7C
subfoldersTable
-
Fields inherited from class com.pff.PSTObject
children, compEnc, data, descriptorIndexNode, items, localDescriptorItems, NID_TYPE_ASSOC_CONTENTS_TABLE, NID_TYPE_ASSOC_MESSAGE, NID_TYPE_ATTACHMENT, NID_TYPE_ATTACHMENT_TABLE, NID_TYPE_CONTENTS_TABLE, NID_TYPE_CONTENTS_TABLE_INDEX, NID_TYPE_HID, NID_TYPE_HIERARCHY_TABLE, NID_TYPE_INTERNAL, NID_TYPE_LTP, NID_TYPE_NORMAL_FOLDER, NID_TYPE_NORMAL_MESSAGE, NID_TYPE_OUTGOING_QUEUE_TABLE, NID_TYPE_RECEIVE_FOLDER_TABLE, NID_TYPE_RECIPIENT_TABLE, NID_TYPE_SEARCH_CONTENTS_TABLE, NID_TYPE_SEARCH_CRITERIA_OBJECT, NID_TYPE_SEARCH_FOLDER, NID_TYPE_SEARCH_TABLE_INDEX, NID_TYPE_SEARCH_UPDATE_QUEUE, pstFile, table
-
-
Constructor Summary
Constructors Constructor Description PSTFolder(PSTFile theFile, DescriptorIndexNode descriptorIndexNode)
a constructor for the rest of us...PSTFolder(PSTFile theFile, DescriptorIndexNode folderIndexNode, PSTTableBC table, java.util.HashMap<java.lang.Integer,PSTDescriptorItem> localDescriptorItems)
For pre-populating a folder object with values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAssociateContentCount()
java.util.LinkedList<java.lang.Integer>
getChildDescriptorNodes()
java.util.Vector<PSTObject>
getChildren(int numberToReturn)
get some children from the folder This is implemented as a cursor of sorts, as there could be thousands and that is just too many to process at once.java.lang.String
getContainerClass()
int
getContainerFlags()
Container flags Integer 32-bit signedint
getContentCount()
the number of emails in this folder this is as reported by the PST file, for a number calculated by the library use getEmailCountint
getFolderType()
the number of emails in this folder this is the count of emails made by the library and will therefore should be more accurate than getContentCountPSTObject
getNextChild()
Get the next child of this folder As there could be thousands of emails, we have these kind of cursor operationsint
getSubFolderCount()
the number of child folders in this folderjava.util.Vector<PSTFolder>
getSubFolders()
get all of the sub folders...int
getUnreadCount()
Amount of unread content items Integer 32-bit signedboolean
hasSubfolders()
does this folder have subfolders once again, read from the PST, use getSubFolderCount if you want to know what the library makes of it allprivate void
initEmailsTable()
this method goes through all of the children and sorts them into one of the three hash sets.private void
initSubfoldersTable()
void
moveChildCursorTo(int newIndex)
move the internal folder cursor to the desired position position 0 is before the first record.-
Methods inherited from class com.pff.PSTObject
apptTimeToCalendar, apptTimeToUTC, convertBigEndianBytesToLong, convertLittleEndianBytesToLong, convertLittleEndianBytesToLong, createAppropriatePSTMessageObject, createJavaString, decode, detectAndLoadPSTObject, detectAndLoadPSTObject, encode, filetimeToDate, getAddrType, getBinaryItem, getBooleanItem, getBooleanItem, getComment, getCreationTime, getDateItem, getDescriptorNode, getDescriptorNodeId, getDisplayName, getDoubleItem, getDoubleItem, getEmailAddress, getIntItem, getIntItem, getItemsString, getLastModificationTime, getLongItem, getLongItem, getMessageClass, getNodeType, getNodeType, getStringItem, getStringItem, getStringItem, getTimeZoneItem, guessPSTObjectType, printFormattedNumber, printFormattedNumber, printHexFormatted, printHexFormatted, toString
-
-
-
-
Field Detail
-
currentEmailIndex
private int currentEmailIndex
internal vars for the tracking of things..
-
otherItems
private java.util.LinkedHashSet<DescriptorIndexNode> otherItems
-
emailsTable
private PSTTable7C emailsTable
-
fallbackEmailsTable
private java.util.LinkedList<DescriptorIndexNode> fallbackEmailsTable
-
subfoldersTable
private PSTTable7C subfoldersTable
-
-
Constructor Detail
-
PSTFolder
PSTFolder(PSTFile theFile, DescriptorIndexNode descriptorIndexNode) throws PSTException, java.io.IOException
a constructor for the rest of us...- Parameters:
theFile
-descriptorIndexNode
-- Throws:
PSTException
java.io.IOException
-
PSTFolder
PSTFolder(PSTFile theFile, DescriptorIndexNode folderIndexNode, PSTTableBC table, java.util.HashMap<java.lang.Integer,PSTDescriptorItem> localDescriptorItems)
For pre-populating a folder object with values. Not recommended for use outside this library- Parameters:
theFile
-folderIndexNode
-table
-
-
-
Method Detail
-
getSubFolders
public java.util.Vector<PSTFolder> getSubFolders() throws PSTException, java.io.IOException
get all of the sub folders... there are not usually thousands, so we just do it in one big operation.- Returns:
- all of the subfolders
- Throws:
PSTException
java.io.IOException
-
initSubfoldersTable
private void initSubfoldersTable() throws java.io.IOException, PSTException
- Throws:
java.io.IOException
PSTException
-
initEmailsTable
private void initEmailsTable() throws PSTException, java.io.IOException
this method goes through all of the children and sorts them into one of the three hash sets.- Throws:
PSTException
java.io.IOException
-
getChildren
public java.util.Vector<PSTObject> getChildren(int numberToReturn) throws PSTException, java.io.IOException
get some children from the folder This is implemented as a cursor of sorts, as there could be thousands and that is just too many to process at once.- Parameters:
numberToReturn
-- Returns:
- bunch of children in this folder
- Throws:
PSTException
java.io.IOException
-
getChildDescriptorNodes
public java.util.LinkedList<java.lang.Integer> getChildDescriptorNodes() throws PSTException, java.io.IOException
- Throws:
PSTException
java.io.IOException
-
getNextChild
public PSTObject getNextChild() throws PSTException, java.io.IOException
Get the next child of this folder As there could be thousands of emails, we have these kind of cursor operations- Returns:
- the next email in the folder or null if at the end of the folder
- Throws:
PSTException
java.io.IOException
-
moveChildCursorTo
public void moveChildCursorTo(int newIndex) throws java.io.IOException, PSTException
move the internal folder cursor to the desired position position 0 is before the first record.- Parameters:
newIndex
-- Throws:
java.io.IOException
PSTException
-
getSubFolderCount
public int getSubFolderCount() throws java.io.IOException, PSTException
the number of child folders in this folder- Returns:
- number of subfolders as counted
- Throws:
java.io.IOException
PSTException
-
getFolderType
public int getFolderType()
the number of emails in this folder this is the count of emails made by the library and will therefore should be more accurate than getContentCount- Returns:
- number of emails in this folder (as counted)
- Throws:
java.io.IOException
PSTException
- public int getEmailCount() throws IOException, PSTException { this.initEmailsTable(); return this.emailsTable.getRowCount(); }
-
getContentCount
public int getContentCount()
the number of emails in this folder this is as reported by the PST file, for a number calculated by the library use getEmailCount- Returns:
- number of items as reported by PST File
-
getUnreadCount
public int getUnreadCount()
Amount of unread content items Integer 32-bit signed
-
hasSubfolders
public boolean hasSubfolders()
does this folder have subfolders once again, read from the PST, use getSubFolderCount if you want to know what the library makes of it all- Returns:
- has subfolders as reported by the PST File
-
getContainerClass
public java.lang.String getContainerClass()
-
getAssociateContentCount
public int getAssociateContentCount()
-
getContainerFlags
public int getContainerFlags()
Container flags Integer 32-bit signed
-
-