source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDconvertToXml.java @ 168

Last change on this file since 168 was 52, checked in by sherbold, 13 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 CMDconvertToXml implements Command {
13
14        @Override
15        public void help() {
16                Console.println("Usage: convertToXml <sourceFile> <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 source = (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).convertToXml(source, 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.