Class PackagePropertiesPart
java.lang.Object
org.apache.poi.openxml4j.opc.PackagePart
org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart
- All Implemented Interfaces:
Comparable<PackagePart>
,PackageProperties
,RelationshipSource
Represents the core properties part of a package.
-
Field Summary
FieldsFields inherited from interface org.apache.poi.openxml4j.opc.PackageProperties
NAMESPACE_DC, NAMESPACE_DCTERMS
-
Constructor Summary
ConstructorsConstructorDescriptionPackagePropertiesPart
(OPCPackage pack, PackagePartName partName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this part : flush this part, close the input stream and output stream.void
flush()
Flush the content of this part.Get the category property.Get content status.Get content type.Get created date.Get created date formatted into a String.Get creator.Get description.Get identifier.Get keywords.Get the language.Get the author of last modifications.Get last printed date.Get last printed date formatted into a String.Get modified date.Get modified date formatted into a String.Get revision.Get subject.Get title.Get version.boolean
load
(InputStream ios) Load the content of this part.boolean
save
(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
(String category) Set the category.void
setCategoryProperty
(Optional<String> category) Set the category.void
setContentStatusProperty
(String contentStatus) Set the content status.void
setContentStatusProperty
(Optional<String> contentStatus) Set the content status.void
setContentTypeProperty
(String contentType) Set the content type.void
setContentTypeProperty
(Optional<String> contentType) Set the content type.void
setCreatedProperty
(String created) Set the created date.void
setCreatedProperty
(Optional<Date> created) Set the created date.void
setCreatorProperty
(String creator) Set the creator.void
setCreatorProperty
(Optional<String> creator) Set the creator.void
setDescriptionProperty
(String description) Set the description.void
setDescriptionProperty
(Optional<String> description) Set the description.void
setIdentifierProperty
(String identifier) Set identifier.void
setIdentifierProperty
(Optional<String> identifier) Set identifier.void
setKeywordsProperty
(String keywords) Set keywords.void
setKeywordsProperty
(Optional<String> keywords) Set keywords.void
setLanguageProperty
(String language) Set language.void
setLanguageProperty
(Optional<String> language) Set language.void
setLastModifiedByProperty
(String lastModifiedBy) Set last modifications author.void
setLastModifiedByProperty
(Optional<String> lastModifiedBy) Set last modifications author.void
setLastPrintedProperty
(String lastPrinted) Set last printed date.void
setLastPrintedProperty
(Optional<Date> lastPrinted) Set last printed date.void
setModifiedProperty
(String modified) Set last modification date.void
setModifiedProperty
(Optional<Date> modified) Set last modification date.void
setRevisionProperty
(String revision) Set revision.void
setRevisionProperty
(Optional<String> revision) Set revision.void
setSubjectProperty
(String subject) Set subject.void
setSubjectProperty
(Optional<String> subject) Set subject.void
setTitleProperty
(String title) Set title.void
setTitleProperty
(Optional<String> title) Set title.void
setVersionProperty
(String version) Set version.void
setVersionProperty
(Optional<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 Details
-
NAMESPACE_DC_URI
- See Also:
-
NAMESPACE_CP_URI
- See Also:
-
NAMESPACE_DCTERMS_URI
- See Also:
-
-
Constructor Details
-
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 Details
-
getCategoryProperty
Get the category property.- Specified by:
getCategoryProperty
in interfacePackageProperties
- Returns:
- property value
-
getContentStatusProperty
Get content status.- Specified by:
getContentStatusProperty
in interfacePackageProperties
- Returns:
- property value
-
getContentTypeProperty
Get content type.- Specified by:
getContentTypeProperty
in interfacePackageProperties
- Returns:
- property value
-
getCreatedProperty
Get created date.- Specified by:
getCreatedProperty
in interfacePackageProperties
- Returns:
- property value
-
getCreatedPropertyString
Get created date formatted into a String.- Returns:
- A string representation of the created date.
-
getCreatorProperty
Get creator.- Specified by:
getCreatorProperty
in interfacePackageProperties
- Returns:
- property value
-
getDescriptionProperty
Get description.- Specified by:
getDescriptionProperty
in interfacePackageProperties
-
getIdentifierProperty
Get identifier.- Specified by:
getIdentifierProperty
in interfacePackageProperties
- Returns:
- property value
-
getKeywordsProperty
Get keywords.- Specified by:
getKeywordsProperty
in interfacePackageProperties
- Returns:
- property value
-
getLanguageProperty
Get the language.- Specified by:
getLanguageProperty
in interfacePackageProperties
- Returns:
- property value
-
getLastModifiedByProperty
Get the author of last modifications.- Specified by:
getLastModifiedByProperty
in interfacePackageProperties
-
getLastPrintedProperty
Get last printed date.- Specified by:
getLastPrintedProperty
in interfacePackageProperties
- Returns:
- property value
-
getLastPrintedPropertyString
Get last printed date formatted into a String.- Returns:
- A string representation of the last printed date.
-
getModifiedProperty
Get modified date.- Specified by:
getModifiedProperty
in interfacePackageProperties
- Returns:
- property value
-
getModifiedPropertyString
Get modified date formatted into a String.- Returns:
- A string representation of the modified date.
-
getRevisionProperty
Get revision.- Specified by:
getRevisionProperty
in interfacePackageProperties
- Returns:
- property value
-
getSubjectProperty
Get subject.- Specified by:
getSubjectProperty
in interfacePackageProperties
- Returns:
- property value
-
getTitleProperty
Get title.- Specified by:
getTitleProperty
in interfacePackageProperties
- Returns:
- property value
-
getVersionProperty
Get version.- Specified by:
getVersionProperty
in interfacePackageProperties
- Returns:
- property value
-
setCategoryProperty
Set the category.- Specified by:
setCategoryProperty
in interfacePackageProperties
-
setCategoryProperty
Set the category.- Specified by:
setCategoryProperty
in interfacePackageProperties
-
setContentStatusProperty
Set the content status.- Specified by:
setContentStatusProperty
in interfacePackageProperties
-
setContentStatusProperty
Set the content status.- Specified by:
setContentStatusProperty
in interfacePackageProperties
-
setContentTypeProperty
Set the content type.- Specified by:
setContentTypeProperty
in interfacePackageProperties
-
setContentTypeProperty
Set the content type.- Specified by:
setContentTypeProperty
in interfacePackageProperties
-
setCreatedProperty
Set the created date.- Specified by:
setCreatedProperty
in interfacePackageProperties
- Throws:
InvalidFormatException
- only since POI 5.2.0, used to throw unchecked exception IllegalArgumentException if format was invalid- See Also:
-
setCreatedProperty
Set the created date.- Specified by:
setCreatedProperty
in interfacePackageProperties
-
setCreatorProperty
Set the creator.- Specified by:
setCreatorProperty
in interfacePackageProperties
-
setCreatorProperty
Set the creator.- Specified by:
setCreatorProperty
in interfacePackageProperties
-
setDescriptionProperty
Set the description.- Specified by:
setDescriptionProperty
in interfacePackageProperties
-
setDescriptionProperty
Set the description.- Specified by:
setDescriptionProperty
in interfacePackageProperties
-
setIdentifierProperty
Set identifier.- Specified by:
setIdentifierProperty
in interfacePackageProperties
-
setIdentifierProperty
Set identifier.- Specified by:
setIdentifierProperty
in interfacePackageProperties
-
setKeywordsProperty
Set keywords.- Specified by:
setKeywordsProperty
in interfacePackageProperties
-
setKeywordsProperty
Set keywords.- Specified by:
setKeywordsProperty
in interfacePackageProperties
-
setLanguageProperty
Set language.- Specified by:
setLanguageProperty
in interfacePackageProperties
-
setLanguageProperty
Set language.- Specified by:
setLanguageProperty
in interfacePackageProperties
-
setLastModifiedByProperty
Set last modifications author.- Specified by:
setLastModifiedByProperty
in interfacePackageProperties
-
setLastModifiedByProperty
Set last modifications author.- Specified by:
setLastModifiedByProperty
in interfacePackageProperties
-
setLastPrintedProperty
Set last printed date.- Specified by:
setLastPrintedProperty
in interfacePackageProperties
- Throws:
InvalidFormatException
- only since POI 5.2.0, used to throw unchecked exception IllegalArgumentException if format was invalid- See Also:
-
setLastPrintedProperty
Set last printed date.- Specified by:
setLastPrintedProperty
in interfacePackageProperties
-
setModifiedProperty
Set last modification date.- Specified by:
setModifiedProperty
in interfacePackageProperties
- Throws:
InvalidFormatException
- only since POI 5.2.0, used to throw unchecked exception IllegalArgumentException if format was invalid- See Also:
-
setModifiedProperty
Set last modification date.- Specified by:
setModifiedProperty
in interfacePackageProperties
-
setRevisionProperty
Set revision.- Specified by:
setRevisionProperty
in interfacePackageProperties
-
setRevisionProperty
Set revision.- Specified by:
setRevisionProperty
in interfacePackageProperties
-
setSubjectProperty
Set subject.- Specified by:
setSubjectProperty
in interfacePackageProperties
-
setSubjectProperty
Set subject.- Specified by:
setSubjectProperty
in interfacePackageProperties
-
setTitleProperty
Set title.- Specified by:
setTitleProperty
in interfacePackageProperties
-
setTitleProperty
Set title.- Specified by:
setTitleProperty
in interfacePackageProperties
-
setVersionProperty
Set version.- Specified by:
setVersionProperty
in interfacePackageProperties
-
setVersionProperty
Set version.- Specified by:
setVersionProperty
in interfacePackageProperties
-
save
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:
- true if the content has been successfully stored, false otherwise. More information about errors may be logged via Log4j 2.
-
load
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, false otherwise. More information about errors may be logged via Log4j 2.
-
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
-