@Test(expected = NullPointerException.class) public void no_field_extractor_type() throws MalformedURLException { Blob blob = new Blob(new BlobMetadata().setUri(Uri.create("http: DefaultDataExtractor extractor = new DefaultDataExtractor(); DocumentStores.add(0, extractor.getName(), documentStore); FieldExtractor field = new FieldExtractor(); field.setName("date"); Extractor fieldExtractor = new Extractor(); fieldExtractor.setValue(""); field.setExtractor(fieldExtractor); extractor.setFields(Arrays.asList(field)); extractorService.extractThenFormatThenStore(0, new HashMap<>(), blob, extractor); }
public List<Document> extractThenFormatThenStore(long jobId, Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor) { List<Document> documents = extractThenFormat(cachedSelectors, blob, extractor); if (documents != null) { DocumentStores.get(jobId, extractor.getName()).get().save(documents); } return documents; }
ExtractorService { public List<Document> extractThenFormatThenStore(long jobId, Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor) { List<Document> documents = extractThenFormat(cachedSelectors, blob, extractor); if (documents != null) { DocumentStores.get(jobId, extractor.getName()).get().save(documents); } return documents; } }
ExtractorService { public List<Document> extractThenFormatThenStore(long jobId, Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor) { List<Document> documents = extractThenFormat(cachedSelectors, blob, extractor); if (documents != null) { DocumentStores.get(jobId, extractor.getName()).get().save(documents); } return documents; } @Inject  ExtractorService(ScriptingService scriptingService); }
ExtractorService { public List<Document> extractThenFormatThenStore(long jobId, Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor) { List<Document> documents = extractThenFormat(cachedSelectors, blob, extractor); if (documents != null) { DocumentStores.get(jobId, extractor.getName()).get().save(documents); } return documents; } @Inject  ExtractorService(ScriptingService scriptingService); Pair<Set<Link>, Set<Link>> extractAndFilterOutlinks(Job job, Uri uri, Map<String, Instance<?>> cachedSelectors, Blob blob, OutlinkExtractor ol); Set<Link> extractOutlinks(Map<String, Instance<?>> cachedSelectors, Blob blob, OutlinkExtractor extractor); List<Document> extractThenFormatThenStore(long jobId, Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor); List<Document> extractThenFormat(Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor); }
ExtractorService { public List<Document> extractThenFormatThenStore(long jobId, Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor) { List<Document> documents = extractThenFormat(cachedSelectors, blob, extractor); if (documents != null) { DocumentStores.get(jobId, extractor.getName()).get().save(documents); } return documents; } @Inject  ExtractorService(ScriptingService scriptingService); Pair<Set<Link>, Set<Link>> extractAndFilterOutlinks(Job job, Uri uri, Map<String, Instance<?>> cachedSelectors, Blob blob, OutlinkExtractor ol); Set<Link> extractOutlinks(Map<String, Instance<?>> cachedSelectors, Blob blob, OutlinkExtractor extractor); List<Document> extractThenFormatThenStore(long jobId, Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor); List<Document> extractThenFormat(Map<String, Instance<?>> cachedSelectors, Blob blob, DataExtractor extractor);  }