ppkarwasz commented on PR #428:
URL: https://github.com/apache/commons-codec/pull/428#issuecomment-4229967427

   @garydgregory,
   
   I have reduced the public footprint slightly, by removing the methods with 
an `InputStream` of unknown size: this is not needed in practice and its 
implementation requires loading the entire stream into memory.
   
   What is left is potentially useful:
   
   - For the Maven plugin I only need `treeId(MessageDigest, Path)`, however 
`blobId(MessageDigest, Path)` is potentially useful to users that want to 
compute both `dir` and `cnt` SWHID identifiers.
   
   - For the use can I gave in the description of the PR (computing the tree 
identifier of an archive **without** extracting its content) additional methods 
are necessary:
     - `treeIdBuilder(MessageDigest)` to bootstrap the process,
     - `addDirectory` and `addFile(FileMode, String, long, InputStream)` to 
register the various entries of the archive. The `blobId(MessageDigest, long, 
InputStream)` is used by the implementation of the latter, so it is worth 
exposing.
     - (optional) I added an `addSymbolicLink` method, which, although not 
strictly necessary, adds a certain elegance to the Commons Compress-based 
example I gave at the beginning.
   
   - If I count correctly, this leaves `blobId(MessageDigest, byte[])` and 
`addFile(FileMode, String, byte[])`, which are low-level operations and are 
left to allow users to use the API, even if the other methods don't fit their 
use case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to