Class DirectoryProperty

java.lang.Object
org.apache.poi.poifs.property.Property
org.apache.poi.poifs.property.DirectoryProperty
All Implemented Interfaces:
Iterable<Property>, POIFSViewable, Child, Parent
Direct Known Subclasses:
RootProperty

public class DirectoryProperty extends Property implements Parent, Iterable<Property>
Directory property
  • Constructor Details

    • DirectoryProperty

      public DirectoryProperty(String name)
      Default constructor
      Parameters:
      name - the name of the directory
    • DirectoryProperty

      protected DirectoryProperty(int index, byte[] array, int offset)
      reader constructor
      Parameters:
      index - index number
      array - byte data
      offset - offset into byte data
  • Method Details

    • changeName

      public boolean changeName(Property property, String newName)
      Change a Property's name
      Parameters:
      property - the Property whose name is being changed
      newName - the new name for the Property
      Returns:
      true if the name change could be made, else false
    • deleteChild

      public boolean deleteChild(Property property)
      Delete a Property
      Parameters:
      property - the Property being deleted
      Returns:
      true if the Property could be deleted, else false
    • isDirectory

      public boolean isDirectory()
      Specified by:
      isDirectory in class Property
      Returns:
      true if a directory type Property
    • preWrite

      protected void preWrite()
      Perform whatever activities need to be performed prior to writing
      Specified by:
      preWrite in class Property
    • getChildren

      public Iterator<Property> getChildren()
      Get an iterator over the children of this Parent; all elements are instances of Property.
      Specified by:
      getChildren in interface Parent
      Returns:
      Iterator of children; may refer to an empty collection
    • iterator

      public Iterator<Property> iterator()
      Get an iterator over the children of this Parent, alias for getChildren() which supports foreach use
      Specified by:
      iterator in interface Iterable<Property>
    • addChild

      public void addChild(Property property) throws IOException
      Add a new child to the collection of children
      Specified by:
      addChild in interface Parent
      Parameters:
      property - the new child to be added; must not be null
      Throws:
      IOException - if we already have a child with the same name