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.FileInputStream;
|
---|
| 4 | import java.io.IOException;
|
---|
| 5 | import java.io.ObjectInputStream;
|
---|
| 6 | import java.security.InvalidParameterException;
|
---|
| 7 | import java.util.List;
|
---|
| 8 |
|
---|
[171] | 9 | import de.ugoe.cs.eventbench.data.GlobalDataContainer;
|
---|
[88] | 10 | import de.ugoe.cs.util.console.Command;
|
---|
| 11 | import de.ugoe.cs.util.console.Console;
|
---|
| 12 |
|
---|
[171] | 13 | /**
|
---|
| 14 | * <p>
|
---|
| 15 | * Command that loads a previously serialized {@link GlobalDataContainer}.
|
---|
| 16 | * </p>
|
---|
| 17 | *
|
---|
| 18 | * @author Steffen Herbold
|
---|
| 19 | * @version 1.0
|
---|
| 20 | */
|
---|
[88] | 21 | public class CMDload 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);
|
---|
| 33 | } catch (Exception e) {
|
---|
| 34 | throw new InvalidParameterException();
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | FileInputStream fis = null;
|
---|
| 38 | ObjectInputStream in = null;
|
---|
| 39 | try {
|
---|
| 40 | fis = new FileInputStream(filename);
|
---|
| 41 | in = new ObjectInputStream(fis);
|
---|
[89] | 42 | in.readObject();
|
---|
[88] | 43 | in.close();
|
---|
| 44 | } catch (IOException ex) {
|
---|
[211] | 45 | Console.logException(ex);
|
---|
[88] | 46 | } catch (ClassNotFoundException ex) {
|
---|
[211] | 47 | Console.logException(ex);
|
---|
[88] | 48 | }
|
---|
| 49 | }
|
---|
| 50 |
|
---|
[171] | 51 | /*
|
---|
| 52 | * (non-Javadoc)
|
---|
| 53 | *
|
---|
| 54 | * @see de.ugoe.cs.util.console.Command#help()
|
---|
| 55 | */
|
---|
[88] | 56 | @Override
|
---|
| 57 | public void help() {
|
---|
[241] | 58 | Console.println("Usage: load <filename>");
|
---|
[88] | 59 | }
|
---|
[171] | 60 |
|
---|
[88] | 61 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.