Package org.apache.poi.poifs.property
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DirectoryProperty.PropertyComparator
-
Field Summary
-
Fields inherited from class org.apache.poi.poifs.property.Property
_NO_INDEX, _NODE_BLACK, _NODE_RED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DirectoryProperty(int index, byte[] array, int offset)
reader constructorDirectoryProperty(String name)
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(Property property)
Add a new child to the collection of childrenboolean
changeName(Property property, String newName)
Change a Property's nameboolean
deleteChild(Property property)
Delete a PropertyIterator<Property>
getChildren()
Get an iterator over the children of this Parent; all elements are instances of Property.boolean
isDirectory()
Iterator<Property>
iterator()
Get an iterator over the children of this Parent, alias forgetChildren()
which supports foreach useprotected void
preWrite()
Perform whatever activities need to be performed prior to writingSpliterator<Property>
spliterator()
Get a spliterator over the children of this Parent; all elements are instances of Property.-
Methods inherited from class org.apache.poi.poifs.property.Property
getChildIndex, getIndex, getName, getNextChild, getPreviousChild, getShortDescription, getSize, getStartBlock, getStorageClsid, getViewableArray, getViewableIterator, isSmall, preferArray, setChildProperty, setIndex, setName, setNextChild, setNodeColor, setPreviousChild, setPropertyType, setSize, setStartBlock, setStorageClsid, shouldUseSmallBlocks, writeData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.poifs.property.Child
getNextChild, getPreviousChild
-
Methods inherited from interface org.apache.poi.poifs.property.Parent
setNextChild, setPreviousChild
-
-
-
-
Constructor Detail
-
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 numberarray
- byte dataoffset
- offset into byte data
-
-
Method Detail
-
changeName
public boolean changeName(Property property, String newName)
Change a Property's name- Parameters:
property
- the Property whose name is being changednewName
- 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 classProperty
- Returns:
- true if a directory type Property
-
preWrite
protected void preWrite()
Perform whatever activities need to be performed prior to writing
-
getChildren
public Iterator<Property> getChildren()
Get an iterator over the children of this Parent; all elements are instances of Property.- Specified by:
getChildren
in interfaceParent
- 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 forgetChildren()
which supports foreach use
-
spliterator
public Spliterator<Property> spliterator()
Get a spliterator over the children of this Parent; all elements are instances of Property.- Specified by:
spliterator
in interfaceIterable<Property>
- Returns:
- Spliterator of children; may refer to an empty collection
- Since:
- POI 5.2.0
-
addChild
public void addChild(Property property) throws IOException
Add a new child to the collection of children- Specified by:
addChild
in interfaceParent
- Parameters:
property
- the new child to be added; must not be null- Throws:
IOException
- if we already have a child with the same name
-
-