private String toPlainText(String code) { // remove [[link|text]] code = RegexUtils.replace(code, "\\[\\[([^\\]|]+)[|]([^\\]|]+)\\]\\]", "$2"); // remove [[link]] code = RegexUtils.replace(code, "\\[\\[([^\\]|]+)\\]\\]", "$1"); // remove ''text'' and '''text''' code = RegexUtils.replace(code, "[']+([^']+)[']+", "$1"); return code; }
@Override public FreehalFile getChild(String name) { String child = path; if (!path.endsWith("/")) child += "/"; child += name; child = RegexUtils.replace(child, "[/]+", "/"); return new FreehalFile(new BerkeleyFile(child)); }