DataONEorg / hashstore-java

HashStore, a hash-based object store for DataONE data packages
Apache License 2.0
1 stars 0 forks source link

`verifyObject` Signature Update #80

Closed doulikecookiedough closed 3 months ago

doulikecookiedough commented 3 months ago

When a client calls storeObject(InputStream stream), a data object is stored immediately with its content identifier. Then later, when the client calls verifyObject to confirm the metadata/checksums after they've received it and there is a mismatch, there is no easy way to remove the data object that was stored.

To assist with the clean-up process, we will add a new boolean argument to the signature of verifyObject, deleteInvalidObject.

public void verifyObject(
    ObjectMetadata objectInfo, String checksum, String checksumAlgorithm, long objSize, boolean deleteInvalidObject
)

When this is set to true, HashStore will attempt to delete the data object associated with the given ObjectMetadata and then throw an exception. Otherwise, it will only throw an exception.

Additional ToDo:

doulikecookiedough commented 3 months ago

This has been completed via Feature-80: 'verifyObject' Signature Update