v0.7.0
Added
getPart()returns relationship parts, so/_rels/.relsand part relationship files can be read throughPartInterfaceas well as the raw part access methods.- Relationships can be added before their source part exists.
validate()and saving report relationship parts whose source part never arrived. - Benchmark coverage for stream opening, small part reads, part registration, and bulk relationship additions.
Changed
- Breaking: raw part-writing methods and
PartInterface::setContents*()reject relationship parts. Change relationships throughgetRelationships(),addRelationship(), andremoveRelationship()so the in-memory collection and its XML stay synchronized. - Breaking:
getRelationships()andaddRelationship()no longer throwPartNotFoundExceptionfor an unknown source part; a mistyped source now surfaces atvalidate()or save time as a missing source part. - Breaking:
RelationshipsandRelationshiphold their package weakly. Operations that need it, such asgetTargetPart(),create(), andretarget(), throw once the package has been released instead of keeping it alive. - Relationship parts are serialized once when read or saved instead of after every change, changed collections stay live between calls, and generated ids no longer rescan from
rId1on every addition. Adding 800 package relationships dropped from about 570 ms to about 2 ms. - Part-name availability checks use an indexed exact, ancestor, and descendant lookup instead of scanning every package entry for each added part.
- Successful saves reuse the verified temporary package fingerprint after atomic replacement instead of hashing the same output a second time.
Fixed
- New packages write
[Content_Types].xmlas the first ZIP entry, as OPC expects for streaming readers, instead of appending it after every part. hasPart()returnsfalsefor package metadata and invalid OPC part names instead of throwing while performing an existence check.
See the full changelog.