Last change
on this file was
241,
checked in by sherbold, 13 years ago
|
- some changes to command parameter orders
- removed command printRandomSesssion
- renamed command loadSessionsFromClickstream do loadWebSequences
|
-
Property svn:mime-type set to
text/plain
|
File size:
1.3 KB
|
Rev | Line | |
---|
[88] | 1 | package de.ugoe.cs.eventbench.commands;
|
---|
| 2 |
|
---|
| 3 | import java.io.FileOutputStream;
|
---|
| 4 | import java.io.IOException;
|
---|
| 5 | import java.io.ObjectOutputStream;
|
---|
| 6 | import java.security.InvalidParameterException;
|
---|
| 7 | import java.util.List;
|
---|
| 8 |
|
---|
| 9 | import de.ugoe.cs.eventbench.data.GlobalDataContainer;
|
---|
| 10 | import de.ugoe.cs.util.console.Command;
|
---|
| 11 | import de.ugoe.cs.util.console.Console;
|
---|
| 12 |
|
---|
[171] | 13 | /**
|
---|
| 14 | * <p>
|
---|
| 15 | * Command to save the {@link GlobalDataContainer} through serialization.
|
---|
| 16 | * </p>
|
---|
| 17 | *
|
---|
| 18 | * @author Steffen Herbold
|
---|
| 19 | * @version 1.0
|
---|
| 20 | */
|
---|
[88] | 21 | public class CMDsave implements Command {
|
---|
| 22 |
|
---|
[171] | 23 | /*
|
---|
| 24 | * (non-Javadoc)
|
---|
| 25 | *
|
---|
| 26 | * @see de.ugoe.cs.util.console.Command#run(java.util.List)
|
---|
| 27 | */
|
---|
[88] | 28 | @Override
|
---|
| 29 | public void run(List<Object> parameters) {
|
---|
| 30 | String filename;
|
---|
| 31 | try {
|
---|
| 32 | filename = (String) parameters.get(0);
|
---|
[171] | 33 | } catch (Exception e) {
|
---|
[88] | 34 | throw new InvalidParameterException();
|
---|
| 35 | }
|
---|
[171] | 36 |
|
---|
[88] | 37 | FileOutputStream fos = null;
|
---|
| 38 | ObjectOutputStream out = null;
|
---|
| 39 | try {
|
---|
| 40 | fos = new FileOutputStream(filename);
|
---|
| 41 | out = new ObjectOutputStream(fos);
|
---|
| 42 | out.writeObject(GlobalDataContainer.getInstance());
|
---|
| 43 | out.close();
|
---|
| 44 | } catch (IOException ex) {
|
---|
[211] | 45 | Console.logException(ex);
|
---|
[88] | 46 | }
|
---|
| 47 | }
|
---|
| 48 |
|
---|
[171] | 49 | /*
|
---|
| 50 | * (non-Javadoc)
|
---|
| 51 | *
|
---|
| 52 | * @see de.ugoe.cs.util.console.Command#help()
|
---|
| 53 | */
|
---|
[88] | 54 | @Override
|
---|
| 55 | public void help() {
|
---|
[241] | 56 | Console.println("Usage: save <filename>");
|
---|
[88] | 57 | }
|
---|
| 58 |
|
---|
| 59 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.