Class PackagePropertiesPart
- java.lang.Object
-
- org.apache.poi.openxml4j.opc.PackagePart
-
- org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart
-
- All Implemented Interfaces:
java.lang.Comparable<PackagePart>
,PackageProperties
,RelationshipSource
public final class PackagePropertiesPart extends PackagePart implements PackageProperties
Represents the core properties part of a package.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAMESPACE_CP_URI
static java.lang.String
NAMESPACE_DC_URI
static java.lang.String
NAMESPACE_DCTERMS_URI
-
Fields inherited from interface org.apache.poi.openxml4j.opc.PackageProperties
NAMESPACE_DC, NAMESPACE_DCTERMS
-
-
Constructor Summary
Constructors Constructor Description PackagePropertiesPart(OPCPackage pack, PackagePartName partName)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this part : flush this part, close the input stream and output stream.void
flush()
Flush the content of this part.java.util.Optional<java.lang.String>
getCategoryProperty()
Get the category property.java.util.Optional<java.lang.String>
getContentStatusProperty()
Get content status.java.util.Optional<java.lang.String>
getContentTypeProperty()
Get content type.java.util.Optional<java.util.Date>
getCreatedProperty()
Get created date.java.lang.String
getCreatedPropertyString()
Get created date formated into a String.java.util.Optional<java.lang.String>
getCreatorProperty()
Get creator.java.util.Optional<java.lang.String>
getDescriptionProperty()
Get description.java.util.Optional<java.lang.String>
getIdentifierProperty()
Get identifier.java.util.Optional<java.lang.String>
getKeywordsProperty()
Get keywords.java.util.Optional<java.lang.String>
getLanguageProperty()
Get the language.java.util.Optional<java.lang.String>
getLastModifiedByProperty()
Get the author of last modifications.java.util.Optional<java.util.Date>
getLastPrintedProperty()
Get last printed date.java.lang.String
getLastPrintedPropertyString()
Get last printed date formated into a String.java.util.Optional<java.util.Date>
getModifiedProperty()
Get modified date.java.lang.String
getModifiedPropertyString()
Get modified date formated into a String.java.util.Optional<java.lang.String>
getRevisionProperty()
Get revision.java.util.Optional<java.lang.String>
getSubjectProperty()
Get subject.java.util.Optional<java.lang.String>
getTitleProperty()
Get title.java.util.Optional<java.lang.String>
getVersionProperty()
Get version.boolean
load(java.io.InputStream ios)
Load the content of this part.boolean
save(java.io.OutputStream zos)
Save the content of this part and the associated relationships part (if this part own at least one relationship) into the specified output stream.void
setCategoryProperty(java.lang.String category)
Set the category.void
setCategoryProperty(java.util.Optional<java.lang.String> category)
Set the category.void
setContentStatusProperty(java.lang.String contentStatus)
Set the content status.void
setContentStatusProperty(java.util.Optional<java.lang.String> contentStatus)
Set the content status.void
setContentTypeProperty(java.lang.String contentType)
Set the content type.void
setContentTypeProperty(java.util.Optional<java.lang.String> contentType)
Set the content type.void
setCreatedProperty(java.lang.String created)
Set the created date.void
setCreatedProperty(java.util.Optional<java.util.Date> created)
Set the created date.void
setCreatorProperty(java.lang.String creator)
Set the creator.void
setCreatorProperty(java.util.Optional<java.lang.String> creator)
Set the creator.void
setDescriptionProperty(java.lang.String description)
Set the description.void
setDescriptionProperty(java.util.Optional<java.lang.String> description)
Set the description.void
setIdentifierProperty(java.lang.String identifier)
Set identifier.void
setIdentifierProperty(java.util.Optional<java.lang.String> identifier)
Set identifier.void
setKeywordsProperty(java.lang.String keywords)
Set keywords.void
setKeywordsProperty(java.util.Optional<java.lang.String> keywords)
Set keywords.void
setLanguageProperty(java.lang.String language)
Set language.void
setLanguageProperty(java.util.Optional<java.lang.String> language)
Set language.void
setLastModifiedByProperty(java.lang.String lastModifiedBy)
Set last modifications author.void
setLastModifiedByProperty(java.util.Optional<java.lang.String> lastModifiedBy)
Set last modifications author.void
setLastPrintedProperty(java.lang.String lastPrinted)
Set last printed date.void
setLastPrintedProperty(java.util.Optional<java.util.Date> lastPrinted)
Set last printed date.void
setModifiedProperty(java.lang.String modified)
Set last modification date.void
setModifiedProperty(java.util.Optional<java.util.Date> modified)
Set last modification date.void
setRevisionProperty(java.lang.String revision)
Set revision.void
setRevisionProperty(java.util.Optional<java.lang.String> revision)
Set revision.void
setSubjectProperty(java.lang.String subject)
Set subject.void
setSubjectProperty(java.util.Optional<java.lang.String> subject)
Set subject.void
setTitleProperty(java.lang.String title)
Set title.void
setTitleProperty(java.util.Optional<java.lang.String> title)
Set title.void
setVersionProperty(java.lang.String version)
Set version.void
setVersionProperty(java.util.Optional<java.lang.String> version)
Set version.-
Methods inherited from class org.apache.poi.openxml4j.opc.PackagePart
addExternalRelationship, addExternalRelationship, addRelationship, addRelationship, addRelationship, addRelationship, clear, clearRelationships, compareTo, findExistingRelation, getContentType, getContentTypeDetails, getInputStream, getOutputStream, getPackage, getPartName, getRelatedPart, getRelationship, getRelationships, getRelationshipsByType, getSize, hasRelationships, isDeleted, isRelationshipExists, isRelationshipPart, removeRelationship, setContentType, setDeleted, toString
-
-
-
-
Field Detail
-
NAMESPACE_DC_URI
public static final java.lang.String NAMESPACE_DC_URI
- See Also:
- Constant Field Values
-
NAMESPACE_CP_URI
public static final java.lang.String NAMESPACE_CP_URI
- See Also:
- Constant Field Values
-
NAMESPACE_DCTERMS_URI
public static final java.lang.String NAMESPACE_DCTERMS_URI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PackagePropertiesPart
public PackagePropertiesPart(OPCPackage pack, PackagePartName partName) throws InvalidFormatException
Constructor.- Parameters:
pack
- Container package.partName
- Name of this part.- Throws:
InvalidFormatException
- Throws if the content is invalid.
-
-
Method Detail
-
getCategoryProperty
public java.util.Optional<java.lang.String> getCategoryProperty()
Get the category property.- Specified by:
getCategoryProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getCategoryProperty()
-
getContentStatusProperty
public java.util.Optional<java.lang.String> getContentStatusProperty()
Get content status.- Specified by:
getContentStatusProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getContentStatusProperty()
-
getContentTypeProperty
public java.util.Optional<java.lang.String> getContentTypeProperty()
Get content type.- Specified by:
getContentTypeProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getContentTypeProperty()
-
getCreatedProperty
public java.util.Optional<java.util.Date> getCreatedProperty()
Get created date.- Specified by:
getCreatedProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getCreatedProperty()
-
getCreatedPropertyString
public java.lang.String getCreatedPropertyString()
Get created date formated into a String.- Returns:
- A string representation of the created date.
-
getCreatorProperty
public java.util.Optional<java.lang.String> getCreatorProperty()
Get creator.- Specified by:
getCreatorProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getCreatorProperty()
-
getDescriptionProperty
public java.util.Optional<java.lang.String> getDescriptionProperty()
Get description.- Specified by:
getDescriptionProperty
in interfacePackageProperties
- See Also:
PackageProperties.getDescriptionProperty()
-
getIdentifierProperty
public java.util.Optional<java.lang.String> getIdentifierProperty()
Get identifier.- Specified by:
getIdentifierProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getIdentifierProperty()
-
getKeywordsProperty
public java.util.Optional<java.lang.String> getKeywordsProperty()
Get keywords.- Specified by:
getKeywordsProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getKeywordsProperty()
-
getLanguageProperty
public java.util.Optional<java.lang.String> getLanguageProperty()
Get the language.- Specified by:
getLanguageProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getLanguageProperty()
-
getLastModifiedByProperty
public java.util.Optional<java.lang.String> getLastModifiedByProperty()
Get the author of last modifications.- Specified by:
getLastModifiedByProperty
in interfacePackageProperties
- See Also:
PackageProperties.getLastModifiedByProperty()
-
getLastPrintedProperty
public java.util.Optional<java.util.Date> getLastPrintedProperty()
Get last printed date.- Specified by:
getLastPrintedProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getLastPrintedProperty()
-
getLastPrintedPropertyString
public java.lang.String getLastPrintedPropertyString()
Get last printed date formated into a String.- Returns:
- A string representation of the last printed date.
-
getModifiedProperty
public java.util.Optional<java.util.Date> getModifiedProperty()
Get modified date.- Specified by:
getModifiedProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getModifiedProperty()
-
getModifiedPropertyString
public java.lang.String getModifiedPropertyString()
Get modified date formated into a String.- Returns:
- A string representation of the modified date.
-
getRevisionProperty
public java.util.Optional<java.lang.String> getRevisionProperty()
Get revision.- Specified by:
getRevisionProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getRevisionProperty()
-
getSubjectProperty
public java.util.Optional<java.lang.String> getSubjectProperty()
Get subject.- Specified by:
getSubjectProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getSubjectProperty()
-
getTitleProperty
public java.util.Optional<java.lang.String> getTitleProperty()
Get title.- Specified by:
getTitleProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getTitleProperty()
-
getVersionProperty
public java.util.Optional<java.lang.String> getVersionProperty()
Get version.- Specified by:
getVersionProperty
in interfacePackageProperties
- Returns:
- property value
- See Also:
PackageProperties.getVersionProperty()
-
setCategoryProperty
public void setCategoryProperty(java.lang.String category)
Set the category.- Specified by:
setCategoryProperty
in interfacePackageProperties
- See Also:
PackageProperties.setCategoryProperty(java.lang.String)
-
setCategoryProperty
public void setCategoryProperty(java.util.Optional<java.lang.String> category)
Set the category.- Specified by:
setCategoryProperty
in interfacePackageProperties
- See Also:
PackageProperties.setCategoryProperty(java.util.Optional)
-
setContentStatusProperty
public void setContentStatusProperty(java.lang.String contentStatus)
Set the content status.- Specified by:
setContentStatusProperty
in interfacePackageProperties
- See Also:
PackageProperties.setContentStatusProperty(java.lang.String)
-
setContentStatusProperty
public void setContentStatusProperty(java.util.Optional<java.lang.String> contentStatus)
Set the content status.- Specified by:
setContentStatusProperty
in interfacePackageProperties
- See Also:
PackageProperties.setContentStatusProperty(java.util.Optional)
-
setContentTypeProperty
public void setContentTypeProperty(java.lang.String contentType)
Set the content type.- Specified by:
setContentTypeProperty
in interfacePackageProperties
- See Also:
PackageProperties.setContentTypeProperty(java.lang.String)
-
setContentTypeProperty
public void setContentTypeProperty(java.util.Optional<java.lang.String> contentType)
Set the content type.- Specified by:
setContentTypeProperty
in interfacePackageProperties
- See Also:
PackageProperties.setContentTypeProperty(java.util.Optional)
-
setCreatedProperty
public void setCreatedProperty(java.lang.String created)
Set the created date.- Specified by:
setCreatedProperty
in interfacePackageProperties
- See Also:
PackageProperties.setCreatedProperty(java.util.Optional)
-
setCreatedProperty
public void setCreatedProperty(java.util.Optional<java.util.Date> created)
Set the created date.- Specified by:
setCreatedProperty
in interfacePackageProperties
- See Also:
PackageProperties.setCreatedProperty(java.util.Optional)
-
setCreatorProperty
public void setCreatorProperty(java.lang.String creator)
Set the creator.- Specified by:
setCreatorProperty
in interfacePackageProperties
- See Also:
PackageProperties.setCreatorProperty(java.lang.String)
-
setCreatorProperty
public void setCreatorProperty(java.util.Optional<java.lang.String> creator)
Set the creator.- Specified by:
setCreatorProperty
in interfacePackageProperties
- See Also:
PackageProperties.setCreatorProperty(java.util.Optional)
-
setDescriptionProperty
public void setDescriptionProperty(java.lang.String description)
Set the description.- Specified by:
setDescriptionProperty
in interfacePackageProperties
- See Also:
PackageProperties.setDescriptionProperty(java.lang.String)
-
setDescriptionProperty
public void setDescriptionProperty(java.util.Optional<java.lang.String> description)
Set the description.- Specified by:
setDescriptionProperty
in interfacePackageProperties
- See Also:
PackageProperties.setDescriptionProperty(java.util.Optional)
-
setIdentifierProperty
public void setIdentifierProperty(java.lang.String identifier)
Set identifier.- Specified by:
setIdentifierProperty
in interfacePackageProperties
- See Also:
PackageProperties.setIdentifierProperty(java.lang.String)
-
setIdentifierProperty
public void setIdentifierProperty(java.util.Optional<java.lang.String> identifier)
Set identifier.- Specified by:
setIdentifierProperty
in interfacePackageProperties
- See Also:
PackageProperties.setIdentifierProperty(java.util.Optional)
-
setKeywordsProperty
public void setKeywordsProperty(java.lang.String keywords)
Set keywords.- Specified by:
setKeywordsProperty
in interfacePackageProperties
- See Also:
PackageProperties.setKeywordsProperty(java.lang.String)
-
setKeywordsProperty
public void setKeywordsProperty(java.util.Optional<java.lang.String> keywords)
Set keywords.- Specified by:
setKeywordsProperty
in interfacePackageProperties
- See Also:
PackageProperties.setKeywordsProperty(java.util.Optional)
-
setLanguageProperty
public void setLanguageProperty(java.lang.String language)
Set language.- Specified by:
setLanguageProperty
in interfacePackageProperties
- See Also:
PackageProperties.setLanguageProperty(java.lang.String)
-
setLanguageProperty
public void setLanguageProperty(java.util.Optional<java.lang.String> language)
Set language.- Specified by:
setLanguageProperty
in interfacePackageProperties
- See Also:
PackageProperties.setLanguageProperty(java.util.Optional)
-
setLastModifiedByProperty
public void setLastModifiedByProperty(java.lang.String lastModifiedBy)
Set last modifications author.- Specified by:
setLastModifiedByProperty
in interfacePackageProperties
- See Also:
PackageProperties.setLastModifiedByProperty(java.lang.String)
-
setLastModifiedByProperty
public void setLastModifiedByProperty(java.util.Optional<java.lang.String> lastModifiedBy)
Set last modifications author.- Specified by:
setLastModifiedByProperty
in interfacePackageProperties
- See Also:
PackageProperties.setLastModifiedByProperty(java.util.Optional)
-
setLastPrintedProperty
public void setLastPrintedProperty(java.lang.String lastPrinted)
Set last printed date.- Specified by:
setLastPrintedProperty
in interfacePackageProperties
- See Also:
PackageProperties.setLastPrintedProperty(java.util.Optional)
-
setLastPrintedProperty
public void setLastPrintedProperty(java.util.Optional<java.util.Date> lastPrinted)
Set last printed date.- Specified by:
setLastPrintedProperty
in interfacePackageProperties
- See Also:
PackageProperties.setLastPrintedProperty(java.util.Optional)
-
setModifiedProperty
public void setModifiedProperty(java.lang.String modified)
Set last modification date.- Specified by:
setModifiedProperty
in interfacePackageProperties
- See Also:
PackageProperties.setModifiedProperty(java.util.Optional)
-
setModifiedProperty
public void setModifiedProperty(java.util.Optional<java.util.Date> modified)
Set last modification date.- Specified by:
setModifiedProperty
in interfacePackageProperties
- See Also:
PackageProperties.setModifiedProperty(java.util.Optional)
-
setRevisionProperty
public void setRevisionProperty(java.util.Optional<java.lang.String> revision)
Set revision.- Specified by:
setRevisionProperty
in interfacePackageProperties
- See Also:
PackageProperties.setRevisionProperty(java.util.Optional)
-
setRevisionProperty
public void setRevisionProperty(java.lang.String revision)
Set revision.- Specified by:
setRevisionProperty
in interfacePackageProperties
- See Also:
PackageProperties.setRevisionProperty(java.lang.String)
-
setSubjectProperty
public void setSubjectProperty(java.lang.String subject)
Set subject.- Specified by:
setSubjectProperty
in interfacePackageProperties
- See Also:
PackageProperties.setSubjectProperty(java.lang.String)
-
setSubjectProperty
public void setSubjectProperty(java.util.Optional<java.lang.String> subject)
Set subject.- Specified by:
setSubjectProperty
in interfacePackageProperties
- See Also:
PackageProperties.setSubjectProperty(java.util.Optional)
-
setTitleProperty
public void setTitleProperty(java.lang.String title)
Set title.- Specified by:
setTitleProperty
in interfacePackageProperties
- See Also:
PackageProperties.setTitleProperty(java.lang.String)
-
setTitleProperty
public void setTitleProperty(java.util.Optional<java.lang.String> title)
Set title.- Specified by:
setTitleProperty
in interfacePackageProperties
- See Also:
PackageProperties.setTitleProperty(java.util.Optional)
-
setVersionProperty
public void setVersionProperty(java.lang.String version)
Set version.- Specified by:
setVersionProperty
in interfacePackageProperties
- See Also:
PackageProperties.setVersionProperty(java.lang.String)
-
setVersionProperty
public void setVersionProperty(java.util.Optional<java.lang.String> version)
Set version.- Specified by:
setVersionProperty
in interfacePackageProperties
- See Also:
PackageProperties.setVersionProperty(java.util.Optional)
-
save
public boolean save(java.io.OutputStream zos)
Description copied from class:PackagePart
Save the content of this part and the associated relationships part (if this part own at least one relationship) into the specified output stream.- Specified by:
save
in classPackagePart
- Parameters:
zos
- Output stream to save this part.- Returns:
- boolean flag that shows if the save succeeded
-
load
public boolean load(java.io.InputStream ios)
Description copied from class:PackagePart
Load the content of this part.- Specified by:
load
in classPackagePart
- Parameters:
ios
- The input stream of the content to load.- Returns:
- true if the content has been successfully loaded, else false.
-
close
public void close()
Description copied from class:PackagePart
Close this part : flush this part, close the input stream and output stream. After this method call, the part must be available for packaging.- Specified by:
close
in classPackagePart
-
flush
public void flush()
Description copied from class:PackagePart
Flush the content of this part. If the input stream and/or output stream as in a waiting state to read or write, the must to empty their respective buffer.- Specified by:
flush
in classPackagePart
-
-