// Core properties
core = new CoreProperties((PackagePropertiesPart)pkg.getPackageProperties() );
// Extended properties
PackageRelationshipCollection extRel =
pkg.getRelationshipsByType(PackageRelationshipTypes.EXTENDED_PROPERTIES);
if(extRel.size() == 1) {
extPart = pkg.getPart( extRel.getRelationship(0));
org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument props = org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument.Factory.parse(
extPart.getInputStream()
);
ext = new ExtendedProperties(props);
} else {
extPart = null;
ext = new ExtendedProperties((org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument)NEW_EXT_INSTANCE.copy());
}
// Custom properties
PackageRelationshipCollection custRel =
pkg.getRelationshipsByType(PackageRelationshipTypes.CUSTOM_PROPERTIES);
if(custRel.size() == 1) {
custPart = pkg.getPart( custRel.getRelationship(0));
org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument props = org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument.Factory.parse(
custPart.getInputStream()
);
cust = new CustomProperties(props);
} else {