Class MutablePropertySet
- java.lang.Object
-
- org.apache.poi.hpsf.PropertySet
-
- org.apache.poi.hpsf.MutablePropertySet
-
- Direct Known Subclasses:
- SpecialPropertySet
public class MutablePropertySet extends PropertySet
Adds writing support to the
PropertySetclass.Please be aware that this class' functionality will be merged into the
PropertySetclass at a later time, so the API will change.
-
-
Field Summary
-
Fields inherited from class org.apache.poi.hpsf.PropertySet
OS_MACINTOSH, OS_WIN16, OS_WIN32
-
-
Constructor Summary
Constructors Constructor and Description MutablePropertySet()Constructs aMutablePropertySetinstance.MutablePropertySet(PropertySet ps)Constructs aMutablePropertySetby doing a deep copy of an existingPropertySet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddSection(Section section)Adds a section to this property set.voidclearSections()Removes all sections from this property set.voidsetByteOrder(int byteOrder)Sets the "byteOrder" property.voidsetClassID(ClassID classID)Sets the property set stream's low-level "class ID" field.voidsetFormat(int format)Sets the "format" property.voidsetOSVersion(int osVersion)Sets the "osVersion" property.java.io.InputStreamtoInputStream()Returns the contents of this property set stream as an input stream.voidwrite(DirectoryEntry dir, java.lang.String name)Writes a property set to a document in a POI filesystem directory.voidwrite(java.io.OutputStream out)Writes the property set to an output stream.-
Methods inherited from class org.apache.poi.hpsf.PropertySet
equals, getByteOrder, getClassID, getFirstSection, getFormat, getOSVersion, getProperties, getSectionCount, getSections, getSingleSection, hashCode, isDocumentSummaryInformation, isPropertySetStream, isPropertySetStream, isSummaryInformation, toString, wasNull
-
-
-
-
Constructor Detail
-
MutablePropertySet
public MutablePropertySet()
Constructs a
MutablePropertySetinstance. Its primary task is to initialize the immutable field with their proper values. It also sets fields that might change to reasonable defaults.
-
MutablePropertySet
public MutablePropertySet(PropertySet ps)
Constructs a
MutablePropertySetby doing a deep copy of an existingPropertySet. All nested elements, i.e.Sections andPropertyinstances, will be their mutable counterparts in the newMutablePropertySet.- Parameters:
ps- The property set to copy
-
-
Method Detail
-
setByteOrder
public void setByteOrder(int byteOrder)
Sets the "byteOrder" property.
- Parameters:
byteOrder- the byteOrder value to set
-
setFormat
public void setFormat(int format)
Sets the "format" property.
- Parameters:
format- the format value to set
-
setOSVersion
public void setOSVersion(int osVersion)
Sets the "osVersion" property.
- Parameters:
osVersion- the osVersion value to set
-
setClassID
public void setClassID(ClassID classID)
Sets the property set stream's low-level "class ID" field.
- Parameters:
classID- The property set stream's low-level "class ID" field.- See Also:
PropertySet.getClassID()
-
clearSections
public void clearSections()
Removes all sections from this property set.
-
addSection
public void addSection(Section section)
Adds a section to this property set.
- Parameters:
section- TheSectionto add. It will be appended after any sections that are already present in the property set and thus become the last section.
-
write
public void write(java.io.OutputStream out) throws WritingNotSupportedException, java.io.IOExceptionWrites the property set to an output stream.
- Parameters:
out- the output stream to write the section to- Throws:
java.io.IOException- if an error when writing to the output stream occursWritingNotSupportedException- if HPSF does not yet support writing a property's variant type.
-
toInputStream
public java.io.InputStream toInputStream() throws java.io.IOException, WritingNotSupportedExceptionReturns the contents of this property set stream as an input stream. The latter can be used for example to write the property set into a POIFS document. The input stream represents a snapshot of the property set. If the latter is modified while the input stream is still being read, the modifications will not be reflected in the input stream but in the
MutablePropertySetonly.- Returns:
- the contents of this property set stream
- Throws:
WritingNotSupportedException- if HPSF does not yet support writing of a property's variant type.java.io.IOException- if an I/O exception occurs.
-
write
public void write(DirectoryEntry dir, java.lang.String name) throws WritingNotSupportedException, java.io.IOException
Writes a property set to a document in a POI filesystem directory.
- Parameters:
dir- The directory in the POI filesystem to write the document to.name- The document's name. If there is already a document with the same name in the directory the latter will be overwritten.- Throws:
WritingNotSupportedExceptionjava.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG