Package org.apache.poi.ooxml
Class POIXMLProperties
- java.lang.Object
-
- org.apache.poi.ooxml.POIXMLProperties
-
public class POIXMLProperties extends java.lang.ObjectWrapper 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 Classes Modifier and Type Class Description static classPOIXMLProperties.CorePropertiesThe core document propertiesstatic classPOIXMLProperties.CustomPropertiesCustom document propertiesstatic classPOIXMLProperties.ExtendedPropertiesExtended document properties
-
Constructor Summary
Constructors Constructor Description POIXMLProperties(OPCPackage docPackage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()Commit changes to the underlying OPC packagePOIXMLProperties.CorePropertiesgetCoreProperties()Returns the core document propertiesPOIXMLProperties.CustomPropertiesgetCustomProperties()Returns the custom document propertiesPOIXMLProperties.ExtendedPropertiesgetExtendedProperties()Returns the extended document propertiesjava.lang.StringgetThumbnailFilename()Returns the name of the Document thumbnail, egthumbnail.jpeg, ornullif there isn't one.java.io.InputStreamgetThumbnailImage()Returns the Document thumbnail image data, ornullif there isn't one.voidsetThumbnail(java.lang.String filename, java.io.InputStream imageData)Sets the Thumbnail for the document, replacing any existing one.
-
-
-
Constructor Detail
-
POIXMLProperties
public POIXMLProperties(OPCPackage docPackage) throws java.io.IOException, OpenXML4JException, XmlException
- Throws:
java.io.IOExceptionOpenXML4JExceptionXmlException
-
-
Method Detail
-
getCoreProperties
public POIXMLProperties.CoreProperties getCoreProperties()
Returns the core document properties- Returns:
- the core document properties
-
getExtendedProperties
public POIXMLProperties.ExtendedProperties getExtendedProperties()
Returns the extended document properties- Returns:
- the extended document properties
-
getCustomProperties
public POIXMLProperties.CustomProperties getCustomProperties()
Returns the custom document properties- Returns:
- the custom document properties
-
getThumbnailFilename
public java.lang.String getThumbnailFilename()
Returns the name of the Document thumbnail, egthumbnail.jpeg, ornullif there isn't one.- Returns:
- The thumbnail filename, or null
-
getThumbnailImage
public java.io.InputStream getThumbnailImage() throws java.io.IOExceptionReturns the Document thumbnail image data, ornullif there isn't one.- Returns:
- The thumbnail data, or null
- Throws:
java.io.IOException- if the thumbnail can't be read
-
setThumbnail
public void setThumbnail(java.lang.String filename, java.io.InputStream imageData) throws java.io.IOExceptionSets the Thumbnail for the document, replacing any existing one.- Parameters:
filename- The filename for the thumbnail image, egthumbnail.jpgimageData- The inputstream to read the thumbnail image from- Throws:
java.io.IOException- if the thumbnail can't be written
-
commit
public void commit() throws java.io.IOExceptionCommit changes to the underlying OPC package- Throws:
java.io.IOException- if the properties can't be savedPOIXMLException- if the properties are erroneous
-
-