use of org.olat.core.util.filter.impl.NekoHTMLFilter in project OpenOLAT by OpenOLAT.
the class XmlDocument method readContent.
// fxdiff FXOLAT-97: index run in infinite loop
protected FileContent readContent(VFSLeaf leaf) throws IOException {
InputStream is = leaf.getInputStream();
// Remove all HTML and Tags
NekoContent output;
try {
output = new NekoHTMLFilter().filter(is);
if (log.isDebug())
log.debug("HTML content without tags :" + output);
} catch (Exception e) {
throw new IOException(e);
} finally {
FileUtils.closeSafely(is);
}
return new FileContent(output.getTitle(), output.getContent());
}
use of org.olat.core.util.filter.impl.NekoHTMLFilter in project OpenOLAT by OpenOLAT.
the class MailManagerImpl method createMultipartAlternative.
private Multipart createMultipartAlternative(String text) throws MessagingException {
String pureText = new NekoHTMLFilter().filter(text, true);
MimeBodyPart textPart = new MimeBodyPart();
textPart.setText(pureText, "utf-8");
MimeBodyPart htmlPart = new MimeBodyPart();
htmlPart.setText(text, "utf-8", "html");
Multipart multipart = new MimeMultipart("alternative");
multipart.addBodyPart(textPart);
multipart.addBodyPart(htmlPart);
return multipart;
}
use of org.olat.core.util.filter.impl.NekoHTMLFilter in project openolat by klemens.
the class XmlDocument method readContent.
// fxdiff FXOLAT-97: index run in infinite loop
protected FileContent readContent(VFSLeaf leaf) throws IOException {
InputStream is = leaf.getInputStream();
// Remove all HTML and Tags
NekoContent output;
try {
output = new NekoHTMLFilter().filter(is);
if (log.isDebug())
log.debug("HTML content without tags :" + output);
} catch (Exception e) {
throw new IOException(e);
} finally {
FileUtils.closeSafely(is);
}
return new FileContent(output.getTitle(), output.getContent());
}
use of org.olat.core.util.filter.impl.NekoHTMLFilter in project openolat by klemens.
the class MailManagerImpl method createMultipartAlternative.
private Multipart createMultipartAlternative(String text) throws MessagingException {
String pureText = new NekoHTMLFilter().filter(text, true);
MimeBodyPart textPart = new MimeBodyPart();
textPart.setText(pureText, "utf-8");
MimeBodyPart htmlPart = new MimeBodyPart();
htmlPart.setText(text, "utf-8", "html");
Multipart multipart = new MimeMultipart("alternative");
multipart.addBodyPart(textPart);
multipart.addBodyPart(htmlPart);
return multipart;
}
Aggregations