test_class.declarator: temporaryFolder = new TemporaryFolder(new File("target"))
test_class.modifier: @Rule
      public final
test_class.original_string: @Rule
      public final TemporaryFolder temporaryFolder = new TemporaryFolder(new File("target"));
test_class.type: TemporaryFolder
test_class.var_name: temporaryFolder
test_class.file: oak-run/src/test/java/org/apache/jackrabbit/oak/plugins/tika/CSVFileBinaryResourceProviderTest.java
test_class.identifier: CSVFileBinaryResourceProviderTest
test_case.body: @Test
      public void testGetBinaries() throws Exception {
          StringBuilder sb = new StringBuilder();
          CSVPrinter p = new CSVPrinter(sb, CSVFileBinaryResourceProvider.FORMAT);
          // BLOB_ID, LENGTH, JCR_MIMETYPE, JCR_ENCODING, JCR_PATH
          p.printRecord("a", 123, "text/plain", null, "/a");
          p.printRecord("a2", 123, "text/plain", null, "/a/c");
          p.printRecord("b", null, "text/plain", null, "/b");
          p.printRecord(null, null, "text/plain", null, "/c");
  
          File dataFile = temporaryFolder.newFile();
          Files.write(sb, dataFile, Charsets.UTF_8);
  
          CSVFileBinaryResourceProvider provider = new CSVFileBinaryResourceProvider(dataFile, new MemoryBlobStore());
  
          Map<String, BinaryResource> binaries = provider.getBinaries("/").uniqueIndex(BinarySourceMapper.BY_BLOBID);
          assertEquals(3, binaries.size());
          assertEquals("a", binaries.get("a").getBlobId());
          assertEquals("/a", binaries.get("a").getPath());
  
          binaries = provider.getBinaries("/a").uniqueIndex(BinarySourceMapper.BY_BLOBID);
          assertEquals(1, binaries.size());
  
          provider.close();
      }
test_case.class_method_signature: CSVFileBinaryResourceProviderTest.testGetBinaries()
test_case.full_signature: @Test public void testGetBinaries()
test_case.identifier: testGetBinaries
test_case.invocations: printRecord printRecord printRecord printRecord newFile write uniqueIndex getBinaries assertEquals size assertEquals getBlobId get assertEquals getPath get uniqueIndex getBinaries assertEquals size close
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetBinaries()
focal_class.declarator: BLOB_ID = "blobId"
focal_class.modifier: private static final
focal_class.original_string: private static final String BLOB_ID = "blobId";
focal_class.type: String
focal_class.var_name: BLOB_ID
focal_class.declarator: LENGTH = "length"
focal_class.modifier: private static final
focal_class.original_string: private static final String LENGTH = "length";
focal_class.type: String
focal_class.var_name: LENGTH
focal_class.declarator: FORMAT = CSVFormat.DEFAULT
              .withCommentMarker('#')
              .withHeader(
                      BLOB_ID,
                      LENGTH,
                      JCR_MIMETYPE,
                      JCR_ENCODING,
                      JCR_PATH
              )
              .withNullString("") //Empty string are considered as null
              .withIgnoreSurroundingSpaces()
              .withSkipHeaderRecord()
focal_class.modifier: static final
focal_class.original_string: static final CSVFormat FORMAT = CSVFormat.DEFAULT
              .withCommentMarker('#')
              .withHeader(
                      BLOB_ID,
                      LENGTH,
                      JCR_MIMETYPE,
                      JCR_ENCODING,
                      JCR_PATH
              )
              .withNullString("") //Empty string are considered as null
              .withIgnoreSurroundingSpaces()
              .withSkipHeaderRecord();
focal_class.type: CSVFormat
focal_class.var_name: FORMAT
focal_class.declarator: log = LoggerFactory.getLogger(getClass())
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: dataFile
focal_class.modifier: private final
focal_class.original_string: private final File dataFile;
focal_class.type: File
focal_class.var_name: dataFile
focal_class.declarator: blobStore
focal_class.modifier: private final
focal_class.original_string: private final BlobStore blobStore;
focal_class.type: BlobStore
focal_class.var_name: blobStore
focal_class.declarator: closer = Closer.create()
focal_class.modifier: private final
focal_class.original_string: private final Closer closer = Closer.create();
focal_class.type: Closer
focal_class.var_name: closer
focal_class.file: oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/CSVFileBinaryResourceProvider.java
focal_class.identifier: CSVFileBinaryResourceProvider
focal_class.interfaces: implements BinaryResourceProvider, Closeable
focal_class.class_method_signature: CSVFileBinaryResourceProvider.CSVFileBinaryResourceProvider(File dataFile, @Nullable BlobStore blobStore)
focal_class.full_signature: public  CSVFileBinaryResourceProvider(File dataFile, @Nullable BlobStore blobStore)
focal_class.identifier: CSVFileBinaryResourceProvider
focal_class.modifiers: public
focal_class.parameters: (File dataFile, @Nullable BlobStore blobStore)
focal_class.signature:  CSVFileBinaryResourceProvider(File dataFile, @Nullable BlobStore blobStore)
focal_class.class_method_signature: CSVFileBinaryResourceProvider.getBinaries(final String path)
focal_class.full_signature: @Override public FluentIterable<BinaryResource> getBinaries(final String path)
focal_class.identifier: getBinaries
focal_class.modifiers: @Override public
focal_class.parameters: (final String path)
focal_class.return: FluentIterable<BinaryResource>
focal_class.signature: FluentIterable<BinaryResource> getBinaries(final String path)
focal_class.class_method_signature: CSVFileBinaryResourceProvider.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: @Override
      public FluentIterable<BinaryResource> getBinaries(final String path) throws IOException {
          CSVParser parser = CSVParser.parse(dataFile, Charsets.UTF_8, FORMAT);
          closer.register(parser);
          return FluentIterable.from(parser)
                  .transform(new RecordTransformer())
                  .filter(notNull())
                  .filter(new Predicate<BinaryResource>() {
                      @Override
                      public boolean apply(BinaryResource input) {
                          return PathUtils.isAncestor(path, input.getPath());
                      }
                  });
      }
focal_method.class_method_signature: CSVFileBinaryResourceProvider.getBinaries(final String path)
focal_method.full_signature: @Override public FluentIterable<BinaryResource> getBinaries(final String path)
focal_method.identifier: getBinaries
focal_method.invocations: parse register filter filter transform from notNull isAncestor getPath
focal_method.modifiers: @Override public
focal_method.parameters: (final String path)
focal_method.return: FluentIterable<BinaryResource>
focal_method.signature: FluentIterable<BinaryResource> getBinaries(final String path)