source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDconvertDirToXml.java @ 75

Last change on this file since 75 was 52, checked in by sherbold, 14 years ago
  • refactored translation layer features for Windows MFC into seperate packages de.ugoe.cs.eventbench.windows.*
File size: 1.1 KB
Line 
1package de.ugoe.cs.eventbench.windows.commands;
2
3import java.io.FileNotFoundException;
4import java.io.IOException;
5import java.security.InvalidParameterException;
6import java.util.List;
7
8import de.ugoe.cs.eventbench.windows.LogPreprocessor;
9import de.ugoe.cs.util.console.Command;
10import de.ugoe.cs.util.console.Console;
11
12public class CMDconvertDirToXml implements Command {
13
14        @Override
15        public void help() {
16                Console.println("Usage: convertToXml <sourceFolder> <targetFile> {<base64>}");
17        }
18
19        @Override
20        public void run(List<Object> parameters) {
21                if( parameters.size() < 2 ) {
22                        throw new InvalidParameterException();
23                }
24                String path = (String) parameters.get(0);
25                String target = (String) parameters.get(1);
26                boolean base64 = false;
27                if( parameters.size() == 3 ) {
28                        base64 = Boolean.parseBoolean((String) parameters.get(2));
29                }
30               
31                try {
32                        new LogPreprocessor(base64).convertDirToXml(path, target);
33                } catch (FileNotFoundException e) {
34                        Console.println(e.getMessage());
35                } catch (IOException e) {
36                        Console.println(e.getMessage());
37                }
38               
39        }
40
41}
Note: See TracBrowser for help on using the repository browser.