Changeset 1220 for trunk/autoquest-plugin-html/src/main/java/de
- Timestamp:
- 06/25/13 15:23:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseDirHTML.java
r1179 r1220 69 69 HTMLLogParser parser = new HTMLLogParser(); 70 70 71 String absolutPath = folder.getAbsolutePath(); 72 String[] files = folder.list(); 73 Arrays.sort(files); 74 75 for (String filename : files) { 76 String source = absolutPath + File.separator + filename; 77 Console.traceln(Level.INFO, "Processing file: " + source); 78 79 try { 80 parser.parseFile(source); 81 } 82 catch (Exception e) { 83 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 84 } 85 } 71 parseFile(folder, parser); 86 72 87 73 Collection<List<Event>> sequences = parser.getSequences(); … … 98 84 } 99 85 86 /** 87 * <p> 88 * recursive method for parsing a directory structures 89 * </p> 90 * 91 * @param file the file object to be parsed. If the file is a folder, the method calls itself 92 * for all children 93 * @param parser the parser to use for parsing the files. 94 */ 95 private void parseFile(File file, HTMLLogParser parser) { 96 if (file.isDirectory()) { 97 String[] children = file.list(); 98 Arrays.sort(children); 99 100 for (String child : children) { 101 File childFile = new File(file, child); 102 parseFile(childFile, parser); 103 } 104 } 105 else if (file.isFile()) { 106 String source = file.getAbsolutePath(); 107 Console.traceln(Level.INFO, "Processing file: " + source); 108 109 try { 110 parser.parseFile(file); 111 } 112 catch (Exception e) { 113 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 114 } 115 } 116 } 117 100 118 /* 101 119 * (non-Javadoc)
Note: See TracChangeset
for help on using the changeset viewer.