Class POIXMLProperties


  • public class POIXMLProperties
    extends Object
    Wrapper around the three different kinds of OOXML properties and metadata a document can have (Core, Extended and Custom), as well Thumbnails.
    • 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 String getThumbnailFilename()
        Returns the name of the Document thumbnail, eg thumbnail.jpeg, or null if there isn't one.
        Returns:
        The thumbnail filename, or null
      • getThumbnailImage

        public InputStream getThumbnailImage()
                                      throws IOException
        Returns the Document thumbnail image data, or null if there isn't one.
        Returns:
        The thumbnail data, or null
        Throws:
        IOException - if the thumbnail can't be read
      • setThumbnail

        public void setThumbnail​(String filename,
                                 InputStream imageData)
                          throws IOException
        Sets the Thumbnail for the document, replacing any existing one.
        Parameters:
        filename - The filename for the thumbnail image, eg thumbnail.jpg
        imageData - The inputstream to read the thumbnail image from
        Throws:
        IOException - if the thumbnail can't be written
      • commit

        public void commit()
                    throws IOException
        Commit changes to the underlying OPC package
        Throws:
        IOException - if the properties can't be saved
        POIXMLException - if the properties are erroneous