Package org.apache.poi.ooxml
Class POIXMLProperties
java.lang.Object
org.apache.poi.ooxml.POIXMLProperties
Wrapper around the three different kinds of OOXML properties
and metadata a document can have (Core, Extended and Custom),
as well Thumbnails.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The core document propertiesstatic class
Custom document propertiesstatic class
Extended document properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
Commit changes to the underlying OPC packageReturns the core document propertiesReturns the custom document propertiesReturns the extended document propertiesReturns the name of the Document thumbnail, egthumbnail.jpeg
, ornull
if there isn't one.Returns the Document thumbnail image data, ornull
if there isn't one.protected PackagePart
Returns thePackagePart
for the Document Thumbnail, ornull
if there isn't onevoid
setThumbnail
(String filename, InputStream imageData) Sets the Thumbnail for the document, replacing any existing one.
-
Constructor Details
-
POIXMLProperties
public POIXMLProperties(OPCPackage docPackage) throws IOException, OpenXML4JException, org.apache.xmlbeans.XmlException - Throws:
IOException
OpenXML4JException
org.apache.xmlbeans.XmlException
-
-
Method Details
-
getCoreProperties
Returns the core document properties- Returns:
- the core document properties
-
getExtendedProperties
Returns the extended document properties- Returns:
- the extended document properties
-
getCustomProperties
Returns the custom document properties- Returns:
- the custom document properties
-
getThumbnailPart
Returns thePackagePart
for the Document Thumbnail, ornull
if there isn't one- Returns:
- The Document Thumbnail part or null
-
getThumbnailFilename
Returns the name of the Document thumbnail, egthumbnail.jpeg
, ornull
if there isn't one.- Returns:
- The thumbnail filename, or null
-
getThumbnailImage
Returns the Document thumbnail image data, ornull
if there isn't one.- Returns:
- The thumbnail data, or null
- Throws:
IOException
- if the thumbnail can't be read
-
setThumbnail
Sets the Thumbnail for the document, replacing any existing one.- Parameters:
filename
- The filename for the thumbnail image, egthumbnail.jpg
imageData
- The inputstream to read the thumbnail image from- Throws:
IOException
- if the thumbnail can't be written
-
commit
Commit changes to the underlying OPC package- Throws:
IOException
- if the properties can't be savedPOIXMLException
- if the properties are erroneous
-