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