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-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/datastore/DataStoreTextWriterTest.java
test_class.identifier: DataStoreTextWriterTest
test_case.body: @Test
      public void inMemoryRecord() throws Exception{
          File fdsDir = temporaryFolder.newFolder();
          FileDataStore fds = DataStoreUtils.createFDS(fdsDir, 10000);
          DataStoreBlobStore dbs = new DataStoreBlobStore(fds);
          ByteArrayInputStream is = new ByteArrayInputStream("".getBytes());
          String blobId = dbs.writeBlob(is);
  
          File writerDir = temporaryFolder.newFolder();
          PreExtractedTextProvider textProvider = new DataStoreTextWriter(writerDir, true);
          assertNull(textProvider.getText("/content", new BlobStoreBlob(dbs, blobId)));
      }
test_case.class_method_signature: DataStoreTextWriterTest.inMemoryRecord()
test_case.full_signature: @Test public void inMemoryRecord()
test_case.identifier: inMemoryRecord
test_case.invocations: newFolder createFDS getBytes writeBlob newFolder assertNull getText
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void inMemoryRecord()
focal_class.declarator: ERROR_BLOB_FILE = "blobs_error.txt"
focal_class.modifier: private static final
focal_class.original_string: private static final String ERROR_BLOB_FILE = "blobs_error.txt";
focal_class.type: String
focal_class.var_name: ERROR_BLOB_FILE
focal_class.declarator: EMPTY_BLOB_FILE = "blobs_empty.txt"
focal_class.modifier: private static final
focal_class.original_string: private static final String EMPTY_BLOB_FILE = "blobs_empty.txt";
focal_class.type: String
focal_class.var_name: EMPTY_BLOB_FILE
focal_class.declarator: log = LoggerFactory.getLogger(DataStoreTextWriter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(DataStoreTextWriter.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: directory
focal_class.modifier: private
focal_class.original_string: private File directory;
focal_class.type: File
focal_class.var_name: directory
focal_class.declarator: emptyBlobsHolder
focal_class.modifier: private final
focal_class.original_string: private final SetHolder emptyBlobsHolder;
focal_class.type: SetHolder
focal_class.var_name: emptyBlobsHolder
focal_class.declarator: errorBlobsHolder
focal_class.modifier: private final
focal_class.original_string: private final SetHolder errorBlobsHolder;
focal_class.type: SetHolder
focal_class.var_name: errorBlobsHolder
focal_class.declarator: closed
focal_class.modifier: private
focal_class.original_string: private boolean closed;
focal_class.type: boolean
focal_class.var_name: closed
focal_class.declarator: dataStoreBlobId = true
focal_class.modifier: private
focal_class.original_string: private boolean dataStoreBlobId = true;
focal_class.type: boolean
focal_class.var_name: dataStoreBlobId
focal_class.declarator: readOnlyMode
focal_class.modifier: private final
focal_class.original_string: private final boolean readOnlyMode;
focal_class.type: boolean
focal_class.var_name: readOnlyMode
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/datastore/DataStoreTextWriter.java
focal_class.identifier: DataStoreTextWriter
focal_class.interfaces: implements TextWriter, Closeable, PreExtractedTextProvider
focal_class.class_method_signature: DataStoreTextWriter.DataStoreTextWriter(File directory, boolean readOnlyMode)
focal_class.full_signature: public  DataStoreTextWriter(File directory, boolean readOnlyMode)
focal_class.identifier: DataStoreTextWriter
focal_class.modifiers: public
focal_class.parameters: (File directory, boolean readOnlyMode)
focal_class.signature:  DataStoreTextWriter(File directory, boolean readOnlyMode)
focal_class.class_method_signature: DataStoreTextWriter.getText(String propertyPath, Blob blob)
focal_class.full_signature: @Override public ExtractedText getText(String propertyPath, Blob blob)
focal_class.identifier: getText
focal_class.modifiers: @Override public
focal_class.parameters: (String propertyPath, Blob blob)
focal_class.return: ExtractedText
focal_class.signature: ExtractedText getText(String propertyPath, Blob blob)
focal_class.class_method_signature: DataStoreTextWriter.write(@NotNull String blobId,@NotNull String text)
focal_class.full_signature: @Override public void write(@NotNull String blobId,@NotNull String text)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull String blobId,@NotNull String text)
focal_class.return: void
focal_class.signature: void write(@NotNull String blobId,@NotNull String text)
focal_class.class_method_signature: DataStoreTextWriter.markEmpty(String blobId)
focal_class.full_signature: @Override public synchronized void markEmpty(String blobId)
focal_class.identifier: markEmpty
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (String blobId)
focal_class.return: void
focal_class.signature: void markEmpty(String blobId)
focal_class.class_method_signature: DataStoreTextWriter.markError(String blobId)
focal_class.full_signature: @Override public synchronized void markError(String blobId)
focal_class.identifier: markError
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (String blobId)
focal_class.return: void
focal_class.signature: void markError(String blobId)
focal_class.class_method_signature: DataStoreTextWriter.isProcessed(String blobId)
focal_class.full_signature: @Override public synchronized boolean isProcessed(String blobId)
focal_class.identifier: isProcessed
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (String blobId)
focal_class.return: boolean
focal_class.signature: boolean isProcessed(String blobId)
focal_class.class_method_signature: DataStoreTextWriter.close()
focal_class.full_signature: @Override public synchronized void close()
focal_class.identifier: close
focal_class.modifiers: @Override public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: DataStoreTextWriter.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: DataStoreTextWriter.getEmptyBlobsHolder()
focal_class.full_signature:  SetHolder getEmptyBlobsHolder()
focal_class.identifier: getEmptyBlobsHolder
focal_class.parameters: ()
focal_class.return: SetHolder
focal_class.signature: SetHolder getEmptyBlobsHolder()
focal_class.class_method_signature: DataStoreTextWriter.getErrorBlobsHolder()
focal_class.full_signature:  SetHolder getErrorBlobsHolder()
focal_class.identifier: getErrorBlobsHolder
focal_class.parameters: ()
focal_class.return: SetHolder
focal_class.signature: SetHolder getErrorBlobsHolder()
focal_class.class_method_signature: DataStoreTextWriter.getFile(String identifier)
focal_class.full_signature: private File getFile(String identifier)
focal_class.identifier: getFile
focal_class.modifiers: private
focal_class.parameters: (String identifier)
focal_class.return: File
focal_class.signature: File getFile(String identifier)
focal_class.class_method_signature: DataStoreTextWriter.stripLength(String blobId)
focal_class.full_signature: private String stripLength(String blobId)
focal_class.identifier: stripLength
focal_class.modifiers: private
focal_class.parameters: (String blobId)
focal_class.return: String
focal_class.signature: String stripLength(String blobId)
focal_class.class_method_signature: DataStoreTextWriter.getEmptyBlobs()
focal_class.full_signature: private Set<String> getEmptyBlobs()
focal_class.identifier: getEmptyBlobs
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> getEmptyBlobs()
focal_class.class_method_signature: DataStoreTextWriter.getErrorBlobs()
focal_class.full_signature: private Set<String> getErrorBlobs()
focal_class.identifier: getErrorBlobs
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> getErrorBlobs()
focal_class.class_method_signature: DataStoreTextWriter.checkIfReadOnlyModeEnabled()
focal_class.full_signature: private void checkIfReadOnlyModeEnabled()
focal_class.identifier: checkIfReadOnlyModeEnabled
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkIfReadOnlyModeEnabled()
focal_class.class_method_signature: DataStoreTextWriter.createLoader(final String fileName)
focal_class.full_signature: private Callable<Set<String>> createLoader(final String fileName)
focal_class.identifier: createLoader
focal_class.modifiers: private
focal_class.parameters: (final String fileName)
focal_class.return: Callable<Set<String>>
focal_class.signature: Callable<Set<String>> createLoader(final String fileName)
focal_class.class_method_signature: DataStoreTextWriter.loadFromFile(File file)
focal_class.full_signature: private Set<String> loadFromFile(File file)
focal_class.identifier: loadFromFile
focal_class.modifiers: private
focal_class.parameters: (File file)
focal_class.return: Set<String>
focal_class.signature: Set<String> loadFromFile(File file)
focal_class.class_method_signature: DataStoreTextWriter.writeToFile(String fileName, Set<String> blobIds)
focal_class.full_signature: private void writeToFile(String fileName, Set<String> blobIds)
focal_class.identifier: writeToFile
focal_class.modifiers: private
focal_class.parameters: (String fileName, Set<String> blobIds)
focal_class.return: void
focal_class.signature: void writeToFile(String fileName, Set<String> blobIds)
focal_class.class_method_signature: DataStoreTextWriter.ensureParentExists(File file)
focal_class.full_signature: private static void ensureParentExists(File file)
focal_class.identifier: ensureParentExists
focal_class.modifiers: private static
focal_class.parameters: (File file)
focal_class.return: void
focal_class.signature: void ensureParentExists(File file)
focal_method.body: @Override
      public ExtractedText getText(String propertyPath, Blob blob) throws IOException {
          String blobId = blob.getContentIdentity();
          if (blobId == null) {
              log.debug("No id found for blob at path {}", propertyPath);
              return null;
          }
  
          blobId = stripLength(blobId);
          //Check for ref being non null to ensure its not an inlined binary
          if (InMemoryDataRecord.isInstance(blobId)) {
              log.debug("Pre extraction is not supported for in memory records. Path {}, BlobId {}", propertyPath, blobId);
              return null;
          }
  
          ExtractedText result = null;
          if (getEmptyBlobs().contains(blobId)) {
              result = ExtractedText.EMPTY;
          } else if (getErrorBlobs().contains(blobId)) {
              result = ExtractedText.ERROR;
          } else {
              File textFile = getFile(blobId);
              if (textFile.exists()) {
                  String text = Files.toString(textFile, Charsets.UTF_8);
                  result = new ExtractedText(ExtractionResult.SUCCESS, text);
              }
          }
  
          if (log.isDebugEnabled()){
              String extractionResult = result != null ? result.getExtractionResult().toString() : null;
              log.debug("Extraction result for [{}] at path [{}] is [{}]", blobId, propertyPath, extractionResult);
          }
          return result;
      }
focal_method.class_method_signature: DataStoreTextWriter.getText(String propertyPath, Blob blob)
focal_method.full_signature: @Override public ExtractedText getText(String propertyPath, Blob blob)
focal_method.identifier: getText
focal_method.invocations: getContentIdentity debug stripLength isInstance debug contains getEmptyBlobs contains getErrorBlobs getFile exists toString isDebugEnabled toString getExtractionResult debug
focal_method.modifiers: @Override public
focal_method.parameters: (String propertyPath, Blob blob)
focal_method.return: ExtractedText
focal_method.signature: ExtractedText getText(String propertyPath, Blob blob)