Changeset 74 for trunk/EventBenchConsole/src
- Timestamp:
- 06/16/11 14:16:36 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/WeblogParser.java
r72 r74 14 14 15 15 import de.ugoe.cs.eventbench.web.data.WebEvent; 16 import de.ugoe.cs.util.FileTools; 16 17 import de.ugoe.cs.util.console.Console; 17 18 … … 49 50 50 51 public void parseFile(String filename) throws IOException, FileNotFoundException, ParseException { 51 File f = new File(filename); 52 FileReader reader = new FileReader(f); 53 char[] buffer = new char[(int) f.length()]; 54 reader.read(buffer); 55 reader.close(); 56 String[] lines = (new String(buffer)).split("\r\n"); 52 String[] lines = FileTools.getLinesFromFile(filename); 57 53 58 54 Map<String, List<Integer>> cookieSessionMap = new HashMap<String, List<Integer>>(); … … 109 105 } 110 106 } 107 pruneShortSequences(); 108 } 109 110 private void pruneShortSequences() { 111 111 Console.traceln(""+sequences.size()+ " user sequences found"); 112 112 // prune sequences shorter than min-length … … 116 116 sequences.remove(i); 117 117 } else { 118 Console.traceln(""+sequences.get(i).size());119 if( sequences.get(i).size() > 152 ) {120 Console.traceln(sequences.get(i).toString().replaceAll(", ", "\n"));121 }122 118 i++; 123 119 } … … 127 123 128 124 private void loadRobotRegex() throws IOException, FileNotFoundException { 129 File f = new File(ROBOTFILTERFILE); 130 FileReader reader = new FileReader(f); 131 char[] buffer = new char[(int) f.length()]; 132 reader.read(buffer); 133 reader.close(); 134 String[] lines = (new String(buffer)).split("\r\n"); 125 String[] lines = FileTools.getLinesFromFile(ROBOTFILTERFILE); 135 126 StringBuilder regex = new StringBuilder(); 136 127 for( int i=0; i<lines.length; i++ ) { -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/LogPreprocessor.java
r52 r74 10 10 import org.apache.commons.codec.binary.Base64; 11 11 12 import de.ugoe.cs.util.FileTools; 12 13 import de.ugoe.cs.util.StringTools; 13 14 import de.ugoe.cs.util.console.Console; … … 65 66 private void processFile(String source, OutputStreamWriter targetFile) 66 67 throws FileNotFoundException, IOException { 67 File f = new File(source); 68 FileReader reader = new FileReader(f); 69 char[] buffer = new char[(int) f.length()]; 70 reader.read(buffer); 71 reader.close(); 72 String[] lines = (new String(buffer)).split("\n"); 68 String[] lines = FileTools.getLinesFromFile(source, false); 73 69 String incompleteLine = ""; 74 70 // Open source and read line by line
Note: See TracChangeset
for help on using the changeset viewer.