- Timestamp:
- 09/09/11 06:23:36 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDconvertDirToXml.java
r52 r171 10 10 import de.ugoe.cs.util.console.Console; 11 11 12 /** 13 * <p> 14 * Command to pre-process all files in a folder. 15 * </p> 16 * 17 * @author Steffen Herbold 18 * @version 1.0 19 */ 12 20 public class CMDconvertDirToXml implements Command { 13 21 22 /* 23 * (non-Javadoc) 24 * 25 * @see de.ugoe.cs.util.console.Command#help() 26 */ 14 27 @Override 15 28 public void help() { … … 17 30 } 18 31 32 /* 33 * (non-Javadoc) 34 * 35 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 36 */ 19 37 @Override 20 38 public void run(List<Object> parameters) { 21 if ( parameters.size() < 2) {39 if (parameters.size() < 2) { 22 40 throw new InvalidParameterException(); 23 41 } … … 25 43 String target = (String) parameters.get(1); 26 44 boolean base64 = false; 27 if ( parameters.size() == 3) {45 if (parameters.size() == 3) { 28 46 base64 = Boolean.parseBoolean((String) parameters.get(2)); 29 47 } 30 48 31 49 try { 32 50 new LogPreprocessor(base64).convertDirToXml(path, target); … … 36 54 Console.println(e.getMessage()); 37 55 } 38 56 39 57 } 40 58 -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDconvertToXml.java
r52 r171 10 10 import de.ugoe.cs.util.console.Console; 11 11 12 /** 13 * <p> 14 * Command to pre-process a single file. 15 * </p> 16 * 17 * @author Steffen Herbold 18 * @version 1.0 19 */ 12 20 public class CMDconvertToXml implements Command { 13 21 22 /* 23 * (non-Javadoc) 24 * 25 * @see de.ugoe.cs.util.console.Command#help() 26 */ 14 27 @Override 15 28 public void help() { … … 17 30 } 18 31 32 /* 33 * (non-Javadoc) 34 * 35 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 36 */ 19 37 @Override 20 38 public void run(List<Object> parameters) { 21 if ( parameters.size() < 2) {39 if (parameters.size() < 2) { 22 40 throw new InvalidParameterException(); 23 41 } … … 25 43 String target = (String) parameters.get(1); 26 44 boolean base64 = false; 27 if ( parameters.size() == 3) {45 if (parameters.size() == 3) { 28 46 base64 = Boolean.parseBoolean((String) parameters.get(2)); 29 47 } 30 48 31 49 try { 32 50 new LogPreprocessor(base64).convertToXml(source, target); … … 36 54 Console.println(e.getMessage()); 37 55 } 38 56 39 57 } 40 58 -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDparseXML.java
r84 r171 10 10 import de.ugoe.cs.util.console.Console; 11 11 12 /** 13 * <p> 14 * Command to parse an XML file with sessions monitored by EventBench's 15 * MFCUsageMonitor. 16 * </p> 17 * 18 * @author Steffen Herbold 19 * @version 1.0 20 */ 12 21 public class CMDparseXML implements Command { 13 22 23 /* (non-Javadoc) 24 * @see de.ugoe.cs.util.console.Command#help() 25 */ 14 26 @Override 15 27 public void help() { … … 17 29 } 18 30 31 /* (non-Javadoc) 32 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 33 */ 19 34 @Override 20 35 public void run(List<Object> parameters) { 21 36 String filename; 22 37 boolean countMessageOccurences = false; 23 38 24 39 try { 25 40 filename = (String) parameters.get(0); 26 if( parameters.size()==2 ) { 27 countMessageOccurences = Boolean.parseBoolean((String) parameters.get(1)); 41 if (parameters.size() == 2) { 42 countMessageOccurences = Boolean 43 .parseBoolean((String) parameters.get(1)); 28 44 } 29 45 } catch (Exception e) { 30 46 throw new InvalidParameterException(); 31 47 } 32 48 33 49 LogParser parser = new LogParser(countMessageOccurences); 34 50 parser.parseFile(filename); 35 51 36 52 List<List<WindowsEvent>> sequences = parser.getSequences(); 37 38 if ( GlobalDataContainer.getInstance().addData("sequences", sequences )) {53 54 if (GlobalDataContainer.getInstance().addData("sequences", sequences)) { 39 55 Console.traceln("Old data \"" + "sequences" + "\" overwritten"); 40 } 56 } 41 57 } 42 58
Note: See TracChangeset
for help on using the changeset viewer.