Last change
on this file since 566 was
434,
checked in by sherbold, 12 years ago
|
- renamed packages to fit QUEST project structure
|
-
Property svn:mime-type set to
text/plain
|
File size:
1.2 KB
|
Line | |
---|
1 | package de.ugoe.cs.quest.ui.commands;
|
---|
2 |
|
---|
3 | import java.security.InvalidParameterException;
|
---|
4 | import java.util.List;
|
---|
5 |
|
---|
6 | import de.ugoe.cs.quest.CommandHelpers;
|
---|
7 | import de.ugoe.cs.quest.ui.GlobalDataContainer;
|
---|
8 | import de.ugoe.cs.util.console.Command;
|
---|
9 | import de.ugoe.cs.util.console.Console;
|
---|
10 | import de.ugoe.cs.util.console.FileOutputListener;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * <p>
|
---|
14 | * Command to start a {@link FileOutputListener}.
|
---|
15 | * </p>
|
---|
16 | *
|
---|
17 | * @author Steffen Herbold
|
---|
18 | * @version 1.0
|
---|
19 | */
|
---|
20 | public class CMDstartFileListener implements Command {
|
---|
21 |
|
---|
22 | /*
|
---|
23 | * (non-Javadoc)
|
---|
24 | *
|
---|
25 | * @see de.ugoe.cs.util.console.Command#run(java.util.List)
|
---|
26 | */
|
---|
27 | @Override
|
---|
28 | public void run(List<Object> parameters) {
|
---|
29 | String filename;
|
---|
30 | try {
|
---|
31 | filename = (String) parameters.get(0);
|
---|
32 | } catch (Exception e) {
|
---|
33 | throw new InvalidParameterException();
|
---|
34 | }
|
---|
35 |
|
---|
36 | FileOutputListener listener = new FileOutputListener(filename);
|
---|
37 | listener.start();
|
---|
38 | if (GlobalDataContainer.getInstance().addData(filename, listener)) {
|
---|
39 | CommandHelpers.dataOverwritten(filename);
|
---|
40 | }
|
---|
41 | }
|
---|
42 |
|
---|
43 | /*
|
---|
44 | * (non-Javadoc)
|
---|
45 | *
|
---|
46 | * @see de.ugoe.cs.util.console.Command#help()
|
---|
47 | */
|
---|
48 | @Override
|
---|
49 | public void help() {
|
---|
50 | Console.println("Usage: startFileListener <filename>");
|
---|
51 | }
|
---|
52 |
|
---|
53 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.