Use NodeStoreFixtureProvider in tika command of oak-run
Reoder the generate first so that one can use 'generate' and 'extract'
in one command only
@@ -99,6 +99,14 @@ public class TextExtractorMain {
checkNotNull(blobStore, "This command requires an external BlobStore configured");
+ if (generate){
+ checkNotNull(dataFile, "Data file path not provided");
+ log.info("Generated csv data to be stored in {}", dataFile.getAbsolutePath());
+ BinaryResourceProvider brp = new NodeStoreBinaryResourceProvider(nodeStore, blobStore);
+ CSVFileGenerator generator = new CSVFileGenerator(dataFile);
+ generator.generate(brp.getBinaries(path));
+ }
+
if (report || extract) {
checkArgument(dataFile.exists(),
"Data file %s does not exist", dataFile.getAbsolutePath());
@@ -112,14 +120,6 @@ public class TextExtractorMain {
log.info(summary);
}
- if (generate){
- checkNotNull(dataFile, "Data file path not provided");
- log.info("Generated csv data to be stored in {}", dataFile.getAbsolutePath());
- BinaryResourceProvider brp = new NodeStoreBinaryResourceProvider(nodeStore, blobStore);
- CSVFileGenerator generator = new CSVFileGenerator(dataFile);
- generator.generate(brp.getBinaries(path));
- }
-
if (extract) {
checkNotNull(storeDir, "Directory to store extracted text content " +
"must be specified via %s", tikaOpts.getStoreDirSpecOpt());
