DuraStoreRetrievalSource implements RetrievalSource { @Override public ContentStream getSourceContent(ContentItem contentItem, RetrievalListener listener) { Content content = doGetContent(contentItem, listener); return new ContentStream(content.getStream(), content.getProperties()); } DuraStoreRetrievalSource(ContentStore store,
                                    List<String> spaces,
                                    boolean allSpaces); @Override synchronized ContentItem getNextContentItem(); @Override Map<String, String> getSourceProperties(ContentItem contentItem); @Override String getSourceChecksum(ContentItem contentItem); @Override ContentStream getSourceContent(ContentItem contentItem, RetrievalListener listener);  }
@Test public void testGetSourceContent() throws Exception { RetrievalSource source = new DuraStoreRetrievalSource(store, null, true); ContentItem contentItem = new ContentItem("spaceId", "contentId"); ContentStream contentStream = source.getSourceContent(contentItem); assertNotNull(contentStream); assertEquals(checksum, contentStream.getChecksum()); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); IOUtils.copy(contentStream.getStream(), outStream); assertEquals(value, outStream.toString("UTF-8")); }