- Timestamp:
- 06/16/11 14:16:36 (13 years ago)
- File:
-
- 1 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++ ) {
Note: See TracChangeset
for help on using the changeset viewer.