rendered paste body public void append(String color, String line) { line = Colors.removeFormattingAndColors(line); line = line.replaceAll("&", "&"); line = line.replaceAll("<", "<"); line = line.replaceAll(">", ">"); Matcher matcher = urlPattern.matcher(line); line = matcher.replaceAll("<a href=\"$1\">$1</a>"); try { Date now = new Date(); String date = DATE_FORMAT.format(now); String time = TIME_FORMAT.format(now); File file = new File(outDir, date + ".log"); BufferedWriter writer = new BufferedWriter(new FileWriter(file, true)); String entry = "<span class=\"irc-date\">[" + time + "]</span> <span class=\"" + color + "\">" + line + "</span><br />"; writer.write(entry); writer.newLine(); writer.flush(); writer.close(); } catch (IOException e) { System.out.println("Could not write to log: " + e); } }