The datastore should understand how to go from Blob -> URI. In the case of S3 it does and uses Blob.getContentId().
If the datastore doesnt know how to do it, then its not supported by the datastore. You might need a DataStore.getSignedURI(Blob b) method. On 24 August 2017 at 08:27, Chetan Mehrotra <chetan.mehro...@gmail.com> wrote: > > Fair point. So this is more about dynamic adaptability than future > > extendibility. But AFIU this could still be achieved without the full > > adaptable machinery: > > > > if (binProp instanceOf SignableBin) { > > URI uri = ((SignableBin) binProp).getSignedURI(); > > if (uri != null) { > > // resolve URI etc. > > } > > } > > This would be tricky. The current logic is like below. > > 1. Oak JCR BinaryImpl holds a ValueImpl > 2. ValueImpl -> PropertyState -> Blob > 3. From Blob following paths are possible > - Blob -> SegmentBlob -> BlobStoreBlob -> DataRecord -> S3DataRecord > - Blob -> ArrayBasedBlob > - Blob ... MongoBlob > > So at JCR level where we have a PropertyState we cannot determine if > the Blob provided by it can provide a signed binary without adding > such instance of check at each place. Hence the adaptor based proposal > > Chetan Mehrotra >