From: adash Date: Thu, 22 Apr 2010 02:56:06 +0000 (+0000) Subject: changes to generate web pages of increased sizes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=69e90114ee44c827f98d740e0c0183cc7a2ddeea;p=IRC.git changes to generate web pages of increased sizes --- diff --git a/Robust/src/Benchmarks/Recovery/Spider/recovery/gendata/GenerateWebFile.java b/Robust/src/Benchmarks/Recovery/Spider/recovery/gendata/GenerateWebFile.java index f263c443..8215e972 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/recovery/gendata/GenerateWebFile.java +++ b/Robust/src/Benchmarks/Recovery/Spider/recovery/gendata/GenerateWebFile.java @@ -12,13 +12,13 @@ public class GenerateWebFile { public static void main(String[] args) { int numFiles = 3000; - int numLinks = 10; + int numLinks = 6; GenerateWebFile gwf = new GenerateWebFile(); gwf.wordList = gwf.fileToVector("wordList"); - for(int i = 0; i < 3000; i++) { + for(int i = 0; i < numFiles; i++) { Random rword = new Random(i); String title = gwf.genTitle(gwf.wordList, rword); - String body = gwf.createBody(numLinks, rword); + String body = gwf.createBody(numLinks, rword, numFiles); //System.out.println("\n\nPassed create Body\n\n"); gwf.createFile(title, i, body); //System.out.println("\n\nPassed create File\n\n"); @@ -37,33 +37,39 @@ public class GenerateWebFile { return title; } - public String createBody(int numlinkinBody, Random rword) { + public String createBody(int numlinkinBody, Random rword, int numFiles) { String body = ""; String hostname = null; int nextRandomWord; for(int i = 0; i< numlinkinBody; i++) { - nextRandomWord = rword.nextInt(3000); + nextRandomWord = rword.nextInt(numFiles); hostname = "dc-11.calit2.uci.edu"; body += "XXXXX
" + "\n"; + StringBuffer s = new StringBuffer(); + for(int j=0; j<10000; j++) { + s.append("Z"); + } + s.append("\n"); + body += s.toString(); } return body; } - public void createFile(String title, int index, String body) { try { String Filename = title+"/"+index+".html"; BufferedWriter out = new BufferedWriter(new FileWriter(index+".html", true)); - out.write(""); - out.write(""); - out.write(""+title+""); + out.write(""+"\n"); + out.write("" + "\n"); + out.write(""+title+""+"\n"); //out.write(title); //out.write(""); - out.write(""); - out.write(""); - out.write("Filling in body
"); + out.write(""+"\n"); + out.write("\n"); + out.write(""+"\n"); + out.write("Filling in body
"+"\n"); out.write(body); - out.write(""); + out.write("
"); out.write(""); out.newLine(); out.flush();