public void copyFixedFiles(File root) { fileList[2] = "help-" + program.getCountryTag() + ".html"; fileList[3] = "help-sim-" + program.getCountryTag() + ".html"; for (int i = fileList.length - 1; i >= 0; i--) { try { java.net.URL url = Report.class.getResource("data/" + fileList[i]); DataInputStream dis = new DataInputStream(url.openStream()); File dest = new File(root, fileList[i]); DataOutputStream dos = new DataOutputStream(new FileOutputStream(dest)); byte[] buffer = new byte[1024]; int count; do { count = dis.read(buffer); if (count != -1) dos.write(buffer, 0, count); } while (count != -1); dis.close(); dos.close(); } catch (IOException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } } } }
f.println(headerStr + " (<a href=\"help-sim-" + program.getCountryTag() + ".html\"><small><font color=\"#000088\">" + msg.getString("Report.WhatIsThis") + "</font></small></a>):</H4>"); f.println("<p><a href=\"" + csvfile + "\">download csv</a></p>");
private int writeLink(int i, AllMatches match) throws jplag.ExitException { HTMLFile f = openHTMLFile(root, "match" + i + "-link.html"); writeHTMLHeader(f, msg.getString("Report.Links")); f.println("<BODY>\n <H3 ALIGN=\"center\">" + TagParser.parse(msg.getString("Report.Matches_for_X1_AND_X2"), new String[] { match.subName(0), match.subName(1) }) + "</H3>"); f.println(" <H1 align=\"center\">" + match.roundedPercent() + "%</H1>\n<CENTER>"); f.println(" <A HREF=\"index.html#matches\" TARGET=\"_top\">" + msg.getString("Report.INDEX") + "</A> - "); f.println(" <A HREF=\"help-" + program.getCountryTag() + ".html\" TARGET=\"_top\">" + msg.getString("Report.HELP") + "</A></CENTER>"); f.println("</BODY>\n</HTML>"); f.close(); return f.bytesWritten(); }