<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Blob from BlobInfo in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/blob-from-blobinfo/m-p/322967#M9968</link>
    <description>&lt;P&gt;I'm getting a result set from ElasticSearch, and then for each object in the result set, I need to get a &lt;CODE&gt;Blob&lt;/CODE&gt; (or a &lt;CODE&gt;Binary&lt;/CODE&gt;) from S3 using only the &lt;CODE&gt;BlobInfo&lt;/CODE&gt; elements from ES (digest, filename, etc.) Best I have come up with so far is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;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 ...)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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" &lt;CODE&gt;BlobProvider&lt;/CODE&gt;?&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 18:16:04 GMT</pubDate>
    <dc:creator>Eric_Ace</dc:creator>
    <dc:date>2021-11-30T18:16:04Z</dc:date>
    <item>
      <title>Blob from BlobInfo</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/blob-from-blobinfo/m-p/322967#M9968</link>
      <description>&lt;P&gt;I'm getting a result set from ElasticSearch, and then for each object in the result set, I need to get a &lt;CODE&gt;Blob&lt;/CODE&gt; (or a &lt;CODE&gt;Binary&lt;/CODE&gt;) from S3 using only the &lt;CODE&gt;BlobInfo&lt;/CODE&gt; elements from ES (digest, filename, etc.) Best I have come up with so far is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;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 ...)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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" &lt;CODE&gt;BlobProvider&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 18:16:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/blob-from-blobinfo/m-p/322967#M9968</guid>
      <dc:creator>Eric_Ace</dc:creator>
      <dc:date>2021-11-30T18:16:04Z</dc:date>
    </item>
  </channel>
</rss>

