Class Folder

java.lang.Object
com.independentsoft.pst.Folder

public class Folder extends Object
The Class Folder.
  • Constructor Details

    • Folder

      public Folder()
      Initializes a new, empty Folder that can be added to a PST with addFolder.
    • Folder

      public Folder(String displayName)
      Initializes a new Folder with the given display name.
      Parameters:
      displayName - the folder display name.
  • Method Details

    • getFolders

      public List<Folder> getFolders(boolean recursive) throws IOException
      Gets the folders.
      Parameters:
      recursive - the recursive
      Returns:
      the folders
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getFolder

      public Folder getFolder(String displayName) throws IOException
      Gets the folder.
      Parameters:
      displayName - the display name
      Returns:
      the folder
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getFolders

      public List<Folder> getFolders() throws IOException
      Gets the folders.
      Returns:
      the folders
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getItems

      public List<Item> getItems() throws IOException
      Gets the items.
      Returns:
      the items
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getItems

      public List<Item> getItems(int endIndex) throws IOException
      Gets the items.
      Parameters:
      endIndex - the end index
      Returns:
      the items
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getItems

      public List<Item> getItems(int startIndex, int endIndex) throws IOException
      Gets the items.
      Parameters:
      startIndex - the start index
      endIndex - 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

      public Table getTable()
      Gets the table.
      Returns:
      the table
    • getDisplayName

      public String getDisplayName()
      Gets the display name.
      Returns:
      the display name
    • setDisplayName

      public void setDisplayName(String displayName) throws IOException
      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

      public String getComment()
      Gets the comment.
      Returns:
      the comment
    • setComment

      public void setComment(String comment) throws IOException
      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

      public String getContainerClass()
      Gets the container class.
      Returns:
      the container class
    • setContainerClass

      public void setContainerClass(String containerClass) throws IOException
      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

      public long addItem(Item item) throws IOException
      Adds an item to this folder. The folder must have been obtained from PstFile.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

      public List<Long> addItems(List<Item> items) throws IOException
      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

      public long addFolder(Folder folder) throws IOException
      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.