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.- Author:
- Julien Chable
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Optional<java.lang.String>categoryA categorization of the content of this package.protected java.util.Optional<java.lang.String>contentStatusThe status of the content.protected java.util.Optional<java.lang.String>contentTypeThe type of content represented, generally defined by a specific use and intended audience.protected java.util.Optional<java.util.Date>createdDate of creation of the resource.protected java.util.Optional<java.lang.String>creatorAn entity primarily responsible for making the content of the resource.protected java.util.Optional<java.lang.String>descriptionAn explanation of the content of the resource.protected java.util.Optional<java.lang.String>identifierAn unambiguous reference to the resource within a given context.protected java.util.Optional<java.lang.String>keywordsA delimited set of keywords to support searching and indexing.protected java.util.Optional<java.lang.String>languageThe language of the intellectual content of the resource.protected java.util.Optional<java.lang.String>lastModifiedByThe user who performed the last modification.protected java.util.Optional<java.util.Date>lastPrintedThe date and time of the last printing.protected java.util.Optional<java.util.Date>modifiedDate on which the resource was changed.static java.lang.StringNAMESPACE_CP_URIstatic java.lang.StringNAMESPACE_DC_URIstatic java.lang.StringNAMESPACE_DCTERMS_URIprotected java.util.Optional<java.lang.String>revisionThe revision number.protected java.util.Optional<java.lang.String>subjectThe topic of the content of the resource.protected java.util.Optional<java.lang.String>titleThe name given to the resource.protected java.util.Optional<java.lang.String>versionThe version number.-
Fields inherited from class org.apache.poi.openxml4j.opc.PackagePart
_container, _contentType, _partName
-
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 voidclose()Close this part : flush this part, close the input stream and output stream.voidflush()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.StringgetCreatedPropertyString()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.protected java.io.InputStreamgetInputStreamImpl()Method that gets the input stream for this part.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.StringgetLastPrintedPropertyString()Get last printed date formated into a String.java.util.Optional<java.util.Date>getModifiedProperty()Get modified date.java.lang.StringgetModifiedPropertyString()Get modified date formated into a String.protected java.io.OutputStreamgetOutputStreamImpl()Method that gets the output stream for this part.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.booleanload(java.io.InputStream ios)Load the content of this part.booleansave(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.voidsetCategoryProperty(java.lang.String category)Set the category.voidsetCategoryProperty(java.util.Optional<java.lang.String> category)Set the category.voidsetContentStatusProperty(java.lang.String contentStatus)Set the content status.voidsetContentStatusProperty(java.util.Optional<java.lang.String> contentStatus)Set the content status.voidsetContentTypeProperty(java.lang.String contentType)Set the content type.voidsetContentTypeProperty(java.util.Optional<java.lang.String> contentType)Set the content type.voidsetCreatedProperty(java.lang.String created)Set the created date.voidsetCreatedProperty(java.util.Optional<java.util.Date> created)Set the created date.voidsetCreatorProperty(java.lang.String creator)Set the creator.voidsetCreatorProperty(java.util.Optional<java.lang.String> creator)Set the creator.voidsetDescriptionProperty(java.lang.String description)Set the description.voidsetDescriptionProperty(java.util.Optional<java.lang.String> description)Set the description.voidsetIdentifierProperty(java.lang.String identifier)Set identifier.voidsetIdentifierProperty(java.util.Optional<java.lang.String> identifier)Set identifier.voidsetKeywordsProperty(java.lang.String keywords)Set keywords.voidsetKeywordsProperty(java.util.Optional<java.lang.String> keywords)Set keywords.voidsetLanguageProperty(java.lang.String language)Set language.voidsetLanguageProperty(java.util.Optional<java.lang.String> language)Set language.voidsetLastModifiedByProperty(java.lang.String lastModifiedBy)Set last modifications author.voidsetLastModifiedByProperty(java.util.Optional<java.lang.String> lastModifiedBy)Set last modifications author.voidsetLastPrintedProperty(java.lang.String lastPrinted)Set last printed date.voidsetLastPrintedProperty(java.util.Optional<java.util.Date> lastPrinted)Set last printed date.voidsetModifiedProperty(java.lang.String modified)Set last modification date.voidsetModifiedProperty(java.util.Optional<java.util.Date> modified)Set last modification date.voidsetRevisionProperty(java.lang.String revision)Set revision.voidsetRevisionProperty(java.util.Optional<java.lang.String> revision)Set revision.voidsetSubjectProperty(java.lang.String subject)Set subject.voidsetSubjectProperty(java.util.Optional<java.lang.String> subject)Set subject.voidsetTitleProperty(java.lang.String title)Set title.voidsetTitleProperty(java.util.Optional<java.lang.String> title)Set title.voidsetVersionProperty(java.lang.String version)Set version.voidsetVersionProperty(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
-
category
protected java.util.Optional<java.lang.String> category
A categorization of the content of this package. [Example: Example values for this property might include: Resume, Letter, Financial Forecast, Proposal, Technical Presentation, and so on. This value might be used by an application's user interface to facilitate navigation of a large set of documents. end example]
-
contentStatus
protected java.util.Optional<java.lang.String> contentStatus
The status of the content. [Example: Values might include "Draft", "Reviewed", and "Final". end example]
-
contentType
protected java.util.Optional<java.lang.String> contentType
The type of content represented, generally defined by a specific use and intended audience. [Example: Values might include "Whitepaper", "Security Bulletin", and "Exam". end example] [Note: This property is distinct from MIME content types as defined in RFC 2616. end note]
-
created
protected java.util.Optional<java.util.Date> created
Date of creation of the resource.
-
creator
protected java.util.Optional<java.lang.String> creator
An entity primarily responsible for making the content of the resource.
-
description
protected java.util.Optional<java.lang.String> description
An explanation of the content of the resource. [Example: Values might include an abstract, table of contents, reference to a graphical representation of content, and a free-text account of the content. end example]
-
identifier
protected java.util.Optional<java.lang.String> identifier
An unambiguous reference to the resource within a given context.
-
keywords
protected java.util.Optional<java.lang.String> keywords
A delimited set of keywords to support searching and indexing. This is typically a list of terms that are not available elsewhere in the properties.
-
language
protected java.util.Optional<java.lang.String> language
The language of the intellectual content of the resource. [Note: IETF RFC 3066 provides guidance on encoding to represent languages. end note]
-
lastModifiedBy
protected java.util.Optional<java.lang.String> lastModifiedBy
The user who performed the last modification. The identification is environment-specific. [Example: A name, email address, or employee ID. end example] It is recommended that this value be as concise as possible.
-
lastPrinted
protected java.util.Optional<java.util.Date> lastPrinted
The date and time of the last printing.
-
modified
protected java.util.Optional<java.util.Date> modified
Date on which the resource was changed.
-
revision
protected java.util.Optional<java.lang.String> revision
The revision number. [Example: This value might indicate the number of saves or revisions, provided the application updates it after each revision. end example]
-
subject
protected java.util.Optional<java.lang.String> subject
The topic of the content of the resource.
-
title
protected java.util.Optional<java.lang.String> title
The name given to the resource.
-
version
protected java.util.Optional<java.lang.String> version
The version number. This value is set by the user or by the application.
-
-
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:
getCategoryPropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getCategoryProperty()
-
getContentStatusProperty
public java.util.Optional<java.lang.String> getContentStatusProperty()
Get content status.- Specified by:
getContentStatusPropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getContentStatusProperty()
-
getContentTypeProperty
public java.util.Optional<java.lang.String> getContentTypeProperty()
Get content type.- Specified by:
getContentTypePropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getContentTypeProperty()
-
getCreatedProperty
public java.util.Optional<java.util.Date> getCreatedProperty()
Get created date.- Specified by:
getCreatedPropertyin 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:
getCreatorPropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getCreatorProperty()
-
getDescriptionProperty
public java.util.Optional<java.lang.String> getDescriptionProperty()
Get description.- Specified by:
getDescriptionPropertyin interfacePackageProperties- See Also:
PackageProperties.getDescriptionProperty()
-
getIdentifierProperty
public java.util.Optional<java.lang.String> getIdentifierProperty()
Get identifier.- Specified by:
getIdentifierPropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getIdentifierProperty()
-
getKeywordsProperty
public java.util.Optional<java.lang.String> getKeywordsProperty()
Get keywords.- Specified by:
getKeywordsPropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getKeywordsProperty()
-
getLanguageProperty
public java.util.Optional<java.lang.String> getLanguageProperty()
Get the language.- Specified by:
getLanguagePropertyin 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:
getLastModifiedByPropertyin interfacePackageProperties- See Also:
PackageProperties.getLastModifiedByProperty()
-
getLastPrintedProperty
public java.util.Optional<java.util.Date> getLastPrintedProperty()
Get last printed date.- Specified by:
getLastPrintedPropertyin 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:
getModifiedPropertyin 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:
getRevisionPropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getRevisionProperty()
-
getSubjectProperty
public java.util.Optional<java.lang.String> getSubjectProperty()
Get subject.- Specified by:
getSubjectPropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getSubjectProperty()
-
getTitleProperty
public java.util.Optional<java.lang.String> getTitleProperty()
Get title.- Specified by:
getTitlePropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getTitleProperty()
-
getVersionProperty
public java.util.Optional<java.lang.String> getVersionProperty()
Get version.- Specified by:
getVersionPropertyin interfacePackageProperties- Returns:
- property value
- See Also:
PackageProperties.getVersionProperty()
-
setCategoryProperty
public void setCategoryProperty(java.lang.String category)
Set the category.- Specified by:
setCategoryPropertyin interfacePackageProperties- See Also:
PackageProperties.setCategoryProperty(java.lang.String)
-
setCategoryProperty
public void setCategoryProperty(java.util.Optional<java.lang.String> category)
Set the category.- Specified by:
setCategoryPropertyin interfacePackageProperties- See Also:
PackageProperties.setCategoryProperty(java.util.Optional)
-
setContentStatusProperty
public void setContentStatusProperty(java.lang.String contentStatus)
Set the content status.- Specified by:
setContentStatusPropertyin 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:
setContentStatusPropertyin interfacePackageProperties- See Also:
PackageProperties.setContentStatusProperty(java.util.Optional)
-
setContentTypeProperty
public void setContentTypeProperty(java.lang.String contentType)
Set the content type.- Specified by:
setContentTypePropertyin 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:
setContentTypePropertyin interfacePackageProperties- See Also:
PackageProperties.setContentTypeProperty(java.util.Optional)
-
setCreatedProperty
public void setCreatedProperty(java.lang.String created)
Set the created date.- Specified by:
setCreatedPropertyin 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:
setCreatedPropertyin interfacePackageProperties- See Also:
PackageProperties.setCreatedProperty(java.util.Optional)
-
setCreatorProperty
public void setCreatorProperty(java.lang.String creator)
Set the creator.- Specified by:
setCreatorPropertyin interfacePackageProperties- See Also:
PackageProperties.setCreatorProperty(java.lang.String)
-
setCreatorProperty
public void setCreatorProperty(java.util.Optional<java.lang.String> creator)
Set the creator.- Specified by:
setCreatorPropertyin interfacePackageProperties- See Also:
PackageProperties.setCreatorProperty(java.util.Optional)
-
setDescriptionProperty
public void setDescriptionProperty(java.lang.String description)
Set the description.- Specified by:
setDescriptionPropertyin interfacePackageProperties- See Also:
PackageProperties.setDescriptionProperty(java.lang.String)
-
setDescriptionProperty
public void setDescriptionProperty(java.util.Optional<java.lang.String> description)
Set the description.- Specified by:
setDescriptionPropertyin interfacePackageProperties- See Also:
PackageProperties.setDescriptionProperty(java.util.Optional)
-
setIdentifierProperty
public void setIdentifierProperty(java.lang.String identifier)
Set identifier.- Specified by:
setIdentifierPropertyin interfacePackageProperties- See Also:
PackageProperties.setIdentifierProperty(java.lang.String)
-
setIdentifierProperty
public void setIdentifierProperty(java.util.Optional<java.lang.String> identifier)
Set identifier.- Specified by:
setIdentifierPropertyin interfacePackageProperties- See Also:
PackageProperties.setIdentifierProperty(java.util.Optional)
-
setKeywordsProperty
public void setKeywordsProperty(java.lang.String keywords)
Set keywords.- Specified by:
setKeywordsPropertyin interfacePackageProperties- See Also:
PackageProperties.setKeywordsProperty(java.lang.String)
-
setKeywordsProperty
public void setKeywordsProperty(java.util.Optional<java.lang.String> keywords)
Set keywords.- Specified by:
setKeywordsPropertyin interfacePackageProperties- See Also:
PackageProperties.setKeywordsProperty(java.util.Optional)
-
setLanguageProperty
public void setLanguageProperty(java.lang.String language)
Set language.- Specified by:
setLanguagePropertyin interfacePackageProperties- See Also:
PackageProperties.setLanguageProperty(java.lang.String)
-
setLanguageProperty
public void setLanguageProperty(java.util.Optional<java.lang.String> language)
Set language.- Specified by:
setLanguagePropertyin interfacePackageProperties- See Also:
PackageProperties.setLanguageProperty(java.util.Optional)
-
setLastModifiedByProperty
public void setLastModifiedByProperty(java.lang.String lastModifiedBy)
Set last modifications author.- Specified by:
setLastModifiedByPropertyin 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:
setLastModifiedByPropertyin interfacePackageProperties- See Also:
PackageProperties.setLastModifiedByProperty(java.util.Optional)
-
setLastPrintedProperty
public void setLastPrintedProperty(java.lang.String lastPrinted)
Set last printed date.- Specified by:
setLastPrintedPropertyin 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:
setLastPrintedPropertyin interfacePackageProperties- See Also:
PackageProperties.setLastPrintedProperty(java.util.Optional)
-
setModifiedProperty
public void setModifiedProperty(java.lang.String modified)
Set last modification date.- Specified by:
setModifiedPropertyin 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:
setModifiedPropertyin interfacePackageProperties- See Also:
PackageProperties.setModifiedProperty(java.util.Optional)
-
setRevisionProperty
public void setRevisionProperty(java.util.Optional<java.lang.String> revision)
Set revision.- Specified by:
setRevisionPropertyin interfacePackageProperties- See Also:
PackageProperties.setRevisionProperty(java.util.Optional)
-
setRevisionProperty
public void setRevisionProperty(java.lang.String revision)
Set revision.- Specified by:
setRevisionPropertyin interfacePackageProperties- See Also:
PackageProperties.setRevisionProperty(java.lang.String)
-
setSubjectProperty
public void setSubjectProperty(java.lang.String subject)
Set subject.- Specified by:
setSubjectPropertyin interfacePackageProperties- See Also:
PackageProperties.setSubjectProperty(java.lang.String)
-
setSubjectProperty
public void setSubjectProperty(java.util.Optional<java.lang.String> subject)
Set subject.- Specified by:
setSubjectPropertyin interfacePackageProperties- See Also:
PackageProperties.setSubjectProperty(java.util.Optional)
-
setTitleProperty
public void setTitleProperty(java.lang.String title)
Set title.- Specified by:
setTitlePropertyin interfacePackageProperties- See Also:
PackageProperties.setTitleProperty(java.lang.String)
-
setTitleProperty
public void setTitleProperty(java.util.Optional<java.lang.String> title)
Set title.- Specified by:
setTitlePropertyin interfacePackageProperties- See Also:
PackageProperties.setTitleProperty(java.util.Optional)
-
setVersionProperty
public void setVersionProperty(java.lang.String version)
Set version.- Specified by:
setVersionPropertyin interfacePackageProperties- See Also:
PackageProperties.setVersionProperty(java.lang.String)
-
setVersionProperty
public void setVersionProperty(java.util.Optional<java.lang.String> version)
Set version.- Specified by:
setVersionPropertyin interfacePackageProperties- See Also:
PackageProperties.setVersionProperty(java.util.Optional)
-
getInputStreamImpl
protected java.io.InputStream getInputStreamImpl()
Description copied from class:PackagePartMethod that gets the input stream for this part.- Specified by:
getInputStreamImplin classPackagePart- Returns:
- input stream for this part
-
getOutputStreamImpl
protected java.io.OutputStream getOutputStreamImpl()
Description copied from class:PackagePartMethod that gets the output stream for this part.- Specified by:
getOutputStreamImplin classPackagePart- Returns:
- output stream for this part
-
save
public boolean save(java.io.OutputStream zos)
Description copied from class:PackagePartSave 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:
savein 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:PackagePartLoad the content of this part.- Specified by:
loadin 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:PackagePartClose 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:
closein classPackagePart
-
flush
public void flush()
Description copied from class:PackagePartFlush 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:
flushin classPackagePart
-
-