Package org.apache.poi.hsmf.datatypes
Class PropertiesChunk
- java.lang.Object
-
- org.apache.poi.hsmf.datatypes.Chunk
-
- org.apache.poi.hsmf.datatypes.PropertiesChunk
-
- Direct Known Subclasses:
MessagePropertiesChunk,StoragePropertiesChunk
public abstract class PropertiesChunk extends Chunk
A Chunk which holds (single) fixed-length properties, and pointer to the variable length ones / multi-valued ones (which get their own chunk).
There are two kinds of PropertiesChunks, which differ only in their headers.
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAMEstatic intPROPERTIES_FLAG_READABLEstatic intPROPERTIES_FLAG_WRITEABLEstatic StringVARIABLE_LENGTH_PROPERTY_PREFIX-
Fields inherited from class org.apache.poi.hsmf.datatypes.Chunk
DEFAULT_NAME_PREFIX
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPropertiesChunk(ChunkGroup parentGroup)Creates a Properties Chunk.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetEntryName()Creates a string to use to identify this chunk in the POI file system object.static intgetMaxRecordLength()Map<MAPIProperty,List<PropertyValue>>getProperties()Returns all the properties in the chunk, along with their values.Map<MAPIProperty,PropertyValue>getRawProperties()Returns all the properties in the chunk, without looking up any chunk-based valuesPropertyValuegetRawValue(MAPIProperty property)Returns the value / pointer to the value chunk of the property, or null if none existsList<PropertyValue>getValues(MAPIProperty property)Returns all values for the given property, looking up chunk based ones as required, of null if none existprotected voidmatchVariableSizedPropertiesToChunks()Called once the parent ChunkGroup has been populated, to match up the Chunks in it with our Variable Sized Properties.protected voidreadProperties(InputStream value)static voidsetMaxRecordLength(int length)voidsetProperty(PropertyValue value)Defines a property.protected voidwriteNodeData(DirectoryEntry directory, List<PropertyValue> values)Write the nodes for variable-length data.protected List<PropertyValue>writeProperties(OutputStream out)Writes the header of the properties.voidwriteProperties(DirectoryEntry directory)Writes this chunk in the specifiedDirectoryEntry.-
Methods inherited from class org.apache.poi.hsmf.datatypes.Chunk
getChunkId, getType, readValue, writeValue
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
VARIABLE_LENGTH_PROPERTY_PREFIX
public static final String VARIABLE_LENGTH_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
PROPERTIES_FLAG_READABLE
public static final int PROPERTIES_FLAG_READABLE
- See Also:
- Constant Field Values
-
PROPERTIES_FLAG_WRITEABLE
public static final int PROPERTIES_FLAG_WRITEABLE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PropertiesChunk
protected PropertiesChunk(ChunkGroup parentGroup)
Creates a Properties Chunk.
-
-
Method Detail
-
setMaxRecordLength
public static void setMaxRecordLength(int length)
- Parameters:
length- the max record length allowed for PropertiesChunk
-
getMaxRecordLength
public static int getMaxRecordLength()
- Returns:
- the max record length allowed for PropertiesChunk
-
getEntryName
public String getEntryName()
Description copied from class:ChunkCreates a string to use to identify this chunk in the POI file system object.- Overrides:
getEntryNamein classChunk
-
getRawProperties
public Map<MAPIProperty,PropertyValue> getRawProperties()
Returns all the properties in the chunk, without looking up any chunk-based values
-
getProperties
public Map<MAPIProperty,List<PropertyValue>> getProperties()
Returns all the properties in the chunk, along with their values.
Any chunk-based values will be looked up and returned as such
-
setProperty
public void setProperty(PropertyValue value)
Defines a property. Multi-valued properties are not yet supported.
-
getValues
public List<PropertyValue> getValues(MAPIProperty property)
Returns all values for the given property, looking up chunk based ones as required, of null if none exist
-
getRawValue
public PropertyValue getRawValue(MAPIProperty property)
Returns the value / pointer to the value chunk of the property, or null if none exists
-
matchVariableSizedPropertiesToChunks
protected void matchVariableSizedPropertiesToChunks()
Called once the parent ChunkGroup has been populated, to match up the Chunks in it with our Variable Sized Properties.
-
readProperties
protected void readProperties(InputStream value) throws IOException
- Throws:
IOException
-
writeProperties
public void writeProperties(DirectoryEntry directory) throws IOException
Writes this chunk in the specifiedDirectoryEntry.- Parameters:
directory- The directory.- Throws:
IOException- If an I/O error occurs.
-
writeNodeData
protected void writeNodeData(DirectoryEntry directory, List<PropertyValue> values) throws IOException
Write the nodes for variable-length data. Those properties are returned bywriteProperties(OutputStream).- Parameters:
directory- The directory.values- The values.- Throws:
IOException- If an I/O error occurs.
-
writeProperties
protected List<PropertyValue> writeProperties(OutputStream out) throws IOException
Writes the header of the properties.- Parameters:
out- TheOutputStream.- Returns:
- The variable-length properties that need to be written in another node.
- Throws:
IOException- If an I/O error occurs.
-
-