BlobsExtractor { public List<Blob> getBlobs(DocumentModel doc) throws ClientException { List<Blob> result = new ArrayList<Blob>(); try { for (Property blobField : getBlobsProperties(doc)) { Blob blob = (Blob) blobField.getValue(); result.add(blob); } } catch (Exception e) { throw new ClientException(e); } return result; }  List<Property> getBlobsProperties(DocumentModel doc); Map<String, List<String>> getBlobFieldPathForDocumentType(
            String documentType); void invalidateDocumentTypeCache(String docType); void invalidateCache(); List<Blob> getBlobs(DocumentModel doc); void setExtractorProperties(Set<String> pathProps, Set<String> excludedPathProps, boolean indexBlobs);  }
@Test public void test() throws Exception { DocumentModel doc = new DocumentModelImpl("/", "doc", "ComplexDoc"); List<Map<String, Object>> vignettes = new ArrayList<Map<String, Object>>(); Map<String, Object> vignette = new HashMap<String, Object>(); vignette.put("width", Long.valueOf(0)); vignette.put("height", Long.valueOf(0)); Blob blob1 = new ByteArrayBlob("foo1 bar1".getBytes("UTF-8"), "text/plain"); blob1.setFilename("file1.txt"); vignette.put("content", blob1); vignettes.add(vignette); vignette = new HashMap<String, Object>(); vignette.put("width", Long.valueOf(0)); vignette.put("height", Long.valueOf(0)); Blob blob2 = new ByteArrayBlob("foo2 bar2".getBytes("UTF-8"), "text/plain"); blob2.setFilename("file2.txt"); vignette.put("content", blob2); vignettes.add(vignette); Map<String, Object> attachedFile = new HashMap<String, Object>(); attachedFile.put("name", "some name"); attachedFile.put("vignettes", vignettes); doc.setPropertyValue("cmpf:attachedFile", (Serializable) attachedFile); Blob blob3 = new ByteArrayBlob("foo3 bar3".getBytes("UTF-8"), "text/plain"); doc.setProperty("file", "content", blob3); BlobsExtractor extractor = new BlobsExtractor(); List<Blob> blobs = extractor.getBlobs(doc); assertEquals(3, blobs.size()); assertTrue(blobs.contains(blob1)); assertTrue(blobs.contains(blob2)); assertTrue(blobs.contains(blob3)); }