| | |
| | | private static final long MILLIS = (long) 1000; |
| | | |
| | | private static final long MINSEC = (long) 60; |
| | | |
| | | |
| | | public String logDirLesen(File logDir) throws IOException, FileNotFoundException, ParseException { |
| | | Blocks blocks = new Blocks(); |
| | | File[] files = logDir.listFiles(); |
| | | for(File file : files) { |
| | | lesen(file, blocks); |
| | | } |
| | | return blocks.getTimeString(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | |
| | | * |
| | | * |
| | | * @param logfile |
| | | * @param blocks |
| | | * @return die Spieldauer als String im Format H:MM:SS |
| | | * @throws FileNotFoundException |
| | | * @throws IOException |
| | | * @throws ParseException |
| | | */ |
| | | public String lesen(File logfile) throws FileNotFoundException, IOException, ParseException { |
| | | public void lesen(File logfile, Blocks blocks) throws FileNotFoundException, IOException, ParseException { |
| | | boolean inPause = false; |
| | | logger.info("Starting to parse log.."); |
| | | Date parseStart = new Date(); |
| | |
| | | ++lineCount; |
| | | String lastLine = ""; |
| | | String line = r.readLine(); |
| | | Blocks blocks = new Blocks(); |
| | | //Blocks blocks = new Blocks(); |
| | | Block currentBlock = new Block(); |
| | | while(line != null) { |
| | | ++lineCount; |
| | |
| | | logger.log(Level.INFO, |
| | | "{0} lines parsed in {1} seconds and {2} milliseconds.", |
| | | new Object[]{lineCount, timeSeconds, restMillis}); |
| | | return blocks.getTimeString(); |
| | | //return blocks.getTimeString(); |
| | | } |
| | | |
| | | class Block { |