@Test public void testOkFileFormat() throws Exception { stage.setAllowedFileFormats(Arrays.asList("ppt", "doc")); stage.setLowerCaseAllowedFileFormats(); if (!stage.okFileFormat("ppt")) { fail("Got false but expected true"); } }
boolean okFileFormat(String fileFormat) { if (lowerCaseAllowedFileFormatsSet == null) { return true; } if (fileFormat == null) { return false; } return lowerCaseAllowedFileFormatsSet.contains(fileFormat.toLowerCase()); }
TextExtractionStage extends AbstractProcessStage { boolean okFileFormat(String fileFormat) { if (lowerCaseAllowedFileFormatsSet == null) { return true; } if (fileFormat == null) { return false; } return lowerCaseAllowedFileFormatsSet.contains(fileFormat.toLowerCase()); } }
TextExtractionStage extends AbstractProcessStage { boolean okFileFormat(String fileFormat) { if (lowerCaseAllowedFileFormatsSet == null) { return true; } if (fileFormat == null) { return false; } return lowerCaseAllowedFileFormatsSet.contains(fileFormat.toLowerCase()); }  }
TextExtractionStage extends AbstractProcessStage { boolean okFileFormat(String fileFormat) { if (lowerCaseAllowedFileFormatsSet == null) { return true; } if (fileFormat == null) { return false; } return lowerCaseAllowedFileFormatsSet.contains(fileFormat.toLowerCase()); }  @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 { boolean okFileFormat(String fileFormat) { if (lowerCaseAllowedFileFormatsSet == null) { return true; } if (fileFormat == null) { return false; } return lowerCaseAllowedFileFormatsSet.contains(fileFormat.toLowerCase()); }  @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);  }