@Test void extractContentShouldIgnoreContentTypeParameters() throws Exception { ContentTypeFilteringTextExtractor contentTypeFilteringTextExtractor = new ContentTypeFilteringTextExtractor(textExtractor, ImmutableSet.of(MimeType.of("application/ics"), MimeType.of("application/zip"))); assertThat(contentTypeFilteringTextExtractor .extractContent(IOUtils.toInputStream("", StandardCharsets.UTF_8), ContentType.of("application/ics; charset=utf-8"))) .isEqualTo(ParsedContent.empty()); verifyNoMoreInteractions(textExtractor); }
@Override public ParsedContent extractContent(InputStream inputStream, ContentType contentType) throws Exception { if (isBlacklisted(contentType.mimeType())) { return ParsedContent.empty(); } return textExtractor.extractContent(inputStream, contentType); }
ContentTypeFilteringTextExtractor implements TextExtractor { @Override public ParsedContent extractContent(InputStream inputStream, ContentType contentType) throws Exception { if (isBlacklisted(contentType.mimeType())) { return ParsedContent.empty(); } return textExtractor.extractContent(inputStream, contentType); } }
ContentTypeFilteringTextExtractor implements TextExtractor { @Override public ParsedContent extractContent(InputStream inputStream, ContentType contentType) throws Exception { if (isBlacklisted(contentType.mimeType())) { return ParsedContent.empty(); } return textExtractor.extractContent(inputStream, contentType); } ContentTypeFilteringTextExtractor(TextExtractor textExtractor, ImmutableSet<MimeType> contentTypeBlacklist); }
ContentTypeFilteringTextExtractor implements TextExtractor { @Override public ParsedContent extractContent(InputStream inputStream, ContentType contentType) throws Exception { if (isBlacklisted(contentType.mimeType())) { return ParsedContent.empty(); } return textExtractor.extractContent(inputStream, contentType); } ContentTypeFilteringTextExtractor(TextExtractor textExtractor, ImmutableSet<MimeType> contentTypeBlacklist); @Override ParsedContent extractContent(InputStream inputStream, ContentType contentType); }
ContentTypeFilteringTextExtractor implements TextExtractor { @Override public ParsedContent extractContent(InputStream inputStream, ContentType contentType) throws Exception { if (isBlacklisted(contentType.mimeType())) { return ParsedContent.empty(); } return textExtractor.extractContent(inputStream, contentType); } ContentTypeFilteringTextExtractor(TextExtractor textExtractor, ImmutableSet<MimeType> contentTypeBlacklist); @Override ParsedContent extractContent(InputStream inputStream, ContentType contentType);  }