}
private static String extractText(String htmlContent) {
if (htmlContent != null && htmlContent.length() > 0) {
Source source = new Source(htmlContent);
TextExtractor extractor = new TextExtractor(source);
extractor.setConvertNonBreakingSpaces(true);
extractor.setExcludeNonHTMLElements(false);
extractor.setIncludeAttributes(false);
String output = extractor.toString();
if (output != null && output.length() > 0) {
return output;
}
}
return null;