Class Folder
java.lang.Object
com.independentsoft.pst.Folder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongAdds a subfolder under this folder.longAdds an item to this folder.Adds many items to this folder in a single pass (one contents-table rebuild and one count update for all).intGets the children count.Gets the comment.Gets the container class.Gets the display name.byte[]Gets the entry id.Gets the folder.Gets the folders.getFolders(boolean recursive) Gets the folders.longgetId()Gets the id.intGets the item count.getItems()Gets the items.getItems(int endIndex) Gets the items.getItems(int startIndex, int endIndex) Gets the items.longGets the parent id.getTable()Gets the table.intGets the unread item count.booleanChecks for sub folders.voidsetComment(String comment) Sets the comment.voidsetContainerClass(String containerClass) Sets the container class.voidsetDisplayName(String displayName) Sets the display name.
-
Constructor Details
-
Folder
public Folder()Initializes a new, emptyFolderthat can be added to a PST with addFolder. -
Folder
-
-
Method Details
-
getFolders
Gets the folders.- Parameters:
recursive- the recursive- Returns:
- the folders
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getFolder
Gets the folder.- Parameters:
displayName- the display name- Returns:
- the folder
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getFolders
Gets the folders.- Returns:
- the folders
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getItems
Gets the items.- Returns:
- the items
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getItems
Gets the items.- Parameters:
endIndex- the end index- Returns:
- the items
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getItems
Gets the items.- Parameters:
startIndex- the start indexendIndex- the end index- Returns:
- the items
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getId
public long getId()Gets the id.- Returns:
- the id
-
getParentId
public long getParentId()Gets the parent id.- Returns:
- the parent id
-
getTable
-
getDisplayName
-
setDisplayName
Sets the display name. For a folder from an editable store the change is persisted on the next save().- Parameters:
displayName- the display name- Throws:
IOException- if an I/O error occurs
-
getComment
-
setComment
Sets the comment. For a folder from an editable store the change is persisted on the next save().- Parameters:
comment- the comment- Throws:
IOException- if an I/O error occurs
-
getItemCount
public int getItemCount()Gets the item count.- Returns:
- the item count
-
getUnreadItemCount
public int getUnreadItemCount()Gets the unread item count.- Returns:
- the unread item count
-
hasSubFolders
public boolean hasSubFolders()Checks for sub folders.- Returns:
- true, if successful
-
getContainerClass
-
setContainerClass
Sets the container class. For a folder from an editable store the change is persisted on the next save().- Parameters:
containerClass- the container class- Throws:
IOException- if an I/O error occurs
-
getChildrenCount
public int getChildrenCount()Gets the children count.- Returns:
- the children count
-
getEntryId
public byte[] getEntryId()Gets the entry id.- Returns:
- the entry id
-
addItem
Adds an item to this folder. The folder must have been obtained fromPstFile.getRoot()of an editable store (e.g.PstFile.create(String)). Returns the new item's node id.- Parameters:
item- the item to add.- Returns:
- the new item's NID.
- Throws:
IOException- if an I/O error occurs.
-
addItems
Adds many items to this folder in a single pass (one contents-table rebuild and one count update for all).- Parameters:
items- the items to add.- Returns:
- the new items' NIDs.
- Throws:
IOException- if an I/O error occurs.
-
addFolder
Adds a subfolder under this folder. Returns the new folder's node id.- Parameters:
folder- the subfolder to add.- Returns:
- the new folder's NID.
- Throws:
IOException- if an I/O error occurs.
-