lines = IOUtils.readLines(reader);
+ if (lines.size() == 1)
+ return lines.get(0);
+ StringBuilder sb = new StringBuilder(raw.length() + lines.size() * BR_LENGTH);
+ for (int i = 0; i < lines.size(); i++) {
+ if (i != 0)
+ sb.append("
");
+ sb.append(lines.get(i));
+ }
+ return sb.toString();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ final static int BR_LENGTH = "
".length();
+
+ public String readSimpleHtml(Item item) {
+ try {
+ StringBuilder sb = new StringBuilder();
+// sb.append("");
+ readAsSimpleHtml((Node) item, sb);
+// sb.append("
");
+// System.out.println(sb);
+ return sb.toString();
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot convert " + item + " to simple HTML", e);
}
}