@Test public void testAddMetadataToDocument() { Map<String, Object> meta = new HashMap<String, Object>(); meta.put("author", "Simon"); meta.put("pages", "5"); stage.addMetadataToDocument(doc, meta); String author = (String)doc.getContentField(stage.getMetadataPrefix() + "author"); String pages = (String)doc.getContentField(stage.getMetadataPrefix() + "pages"); if (!"Simon".equals(author)) { fail("Expected Simon Got: " + author + " in field " + stage.getMetadataPrefix() + "author"); } if (!"5".equals(pages)) { fail("Expected 5 Got: " + pages + " in field " + stage.getMetadataPrefix() + "pages"); } }
void addMetadataToDocument(LocalDocument doc, Map<String, Object> metadata) { for (String name : metadata.keySet()) { doc.putContentField(metadataPrefix + name, metadata.get(name)); } }
TextExtractionStage extends AbstractProcessStage { void addMetadataToDocument(LocalDocument doc, Map<String, Object> metadata) { for (String name : metadata.keySet()) { doc.putContentField(metadataPrefix + name, metadata.get(name)); } } }
TextExtractionStage extends AbstractProcessStage { void addMetadataToDocument(LocalDocument doc, Map<String, Object> metadata) { for (String name : metadata.keySet()) { doc.putContentField(metadataPrefix + name, metadata.get(name)); } }  }
TextExtractionStage extends AbstractProcessStage { void addMetadataToDocument(LocalDocument doc, Map<String, Object> metadata) { for (String name : metadata.keySet()) { doc.putContentField(metadataPrefix + name, metadata.get(name)); } }  @Override void process(LocalDocument doc); @Override void init(); void setUrlField(String urlField); void setContentField(String contentField); String getContentField(); void setMetadatPrefix(String prefix); String getMetadataPrefix(); long getMaxSizeInBytes(); void setMaxSizeInBytes(long size); String getFileSizeField(); void setFileSizeField(String fileSizeField); String getFileFormatField(); void setFileFormatField(String fileFormatField); List<String> getAllowedFileFormats(); void setAllowedFileFormats(List<String> allowedFileFormats); }
TextExtractionStage extends AbstractProcessStage { void addMetadataToDocument(LocalDocument doc, Map<String, Object> metadata) { for (String name : metadata.keySet()) { doc.putContentField(metadataPrefix + name, metadata.get(name)); } }  @Override void process(LocalDocument doc); @Override void init(); void setUrlField(String urlField); void setContentField(String contentField); String getContentField(); void setMetadatPrefix(String prefix); String getMetadataPrefix(); long getMaxSizeInBytes(); void setMaxSizeInBytes(long size); String getFileSizeField(); void setFileSizeField(String fileSizeField); String getFileFormatField(); void setFileFormatField(String fileFormatField); List<String> getAllowedFileFormats(); void setAllowedFileFormats(List<String> allowedFileFormats);  }