Blob from BlobInfo

I'm getting a result set from ElasticSearch, and then for each object in the result set, I need to get a Blob (or a Binary) from S3 using only the BlobInfo elements from ES (digest, filename, etc.) Best I have come up with so far is:

BlobProvider provider = Framework.getService(BlobManager.class).getBlobProviders().values()
.stream().findFirst().orElse(null);

// then use the provider to get the  blob:
Blob blob = provider.readBlob(new BlobInfo(... from ElasticSearch result elements ...)

In my testing, there appears to only ever be one provider - that's true even in the unit test environment. Is there a better / more reliable way to get the one and only one “active” BlobProvider?

0 votes

0 answers

97 views

ANSWER