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 classThe core document propertiesstatic classCustom document propertiesstatic classExtended document properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()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, ornullif there isn't one.Returns the Document thumbnail image data, ornullif there isn't one.protected PackagePartReturns thePackagePartfor the Document Thumbnail, ornullif there isn't onevoidsetThumbnail(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:
IOExceptionOpenXML4JExceptionorg.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 thePackagePartfor the Document Thumbnail, ornullif there isn't one- Returns:
- The Document Thumbnail part or null
-
getThumbnailFilename
Returns the name of the Document thumbnail, egthumbnail.jpeg, ornullif there isn't one.- Returns:
- The thumbnail filename, or null
-
getThumbnailImage
Returns the Document thumbnail image data, ornullif 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.jpgimageData- 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
-