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();
}
}
final static int BR_LENGTH = "
".length();
public String readSimpleHtml(Content item) {
StringBuilder sb = new StringBuilder();
// sb.append("");
readAsSimpleHtml(item, sb);
// sb.append("
");
// System.out.println(sb);
return sb.toString();
}
// EXTENSIBILITY
/**
* To be overridden, in order to make sure that only valid strings are being
* stored.
*/
protected void validateBeforeStoring(String raw) {
}
/** To be overridden, in order to support additional formatting. */
protected String convertToStorage(Content item, String content) {
return content;
}
/** To be overridden, in order to support additional formatting. */
protected String convertFromStorage(Content item, String content) {
return content;
}
}