Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Provides an optional
HardLinkIdentitySuppliercapability for resources whose contents can share one hard-link payload. A resource backed by a file can supply replacement or transformed contents; using the backing inode alone to combine archive entries can discard distinct output bytes.getHardLinkIdentity()returns an opaque, source-scoped identity for equality comparisons, ornullwhen the relationship cannot be guaranteed.PlexusIoFileResourcesupplies an identity for direct, untransformed regular-file contents. It reads attributes without following symbolic links and includes filesystem scope, file key, size, and modification time. Missing file keys, custom suppliers, transformations, and subclasses without an explicit guarantee yieldnull.Deferredpreserves source identity when its contents are untransformed.HardLinkIdentitySupplierguarantee.Related issue
Provides the resource API used by Plexus Archiver PR #493 for TAR hard-link preservation, addressing the resource integration question in PR #286. TAR creation, extraction, and configuration reside in the archiver PR.
The companion archiver uses this artifact as
plexus-io:3.7.1-SNAPSHOT. Install this branch withmvn installbefore building the archiver locally.Anything reviewers should look at closely?
The capability is optional for resource implementations.
PlexusIoFileResourceimplements it, and proxies expose it when their target or alternate supplier does.Equal identities identify the same content within a stable source. Consumers may cache them for one archive operation and must also compare the output metadata they intend to write. The contract assumes the source remains stable while it is read; matching bytes from unrelated files do not establish hard-link identity.
Validation
mvn install javadoc:javadoc: 61 tests, 0 failures, 0 errors, 0 skips on Linux/JDK 17.mvn spotless:checkandgit diff --checkpassed.Validation covers Linux; Windows and macOS have not been validated.