static void CommandTest() { //Creating the receiver object IFileSystemReceiver fs = FileSystemReceiverUtil.getUnderlyingFileSystem(); //creating command and associating with receiver OpenFileCommand openFileCommand = new OpenFileCommand(fs); //Creating invoker and associating with Command FileInvoker file = new FileInvoker(openFileCommand); //perform action on invoker object file.execute(); WriteFileCommand writeFileCommand = new WriteFileCommand(fs); file = new FileInvoker(writeFileCommand); file.execute(); CloseFileCommand closeFileCommand = new CloseFileCommand(fs); file = new FileInvoker(closeFileCommand); file.execute(); }
public WriteFileCommand(IFileSystemReceiver fs) { this.fileSystem = fs; }
public WriteFileCommand(IFileSystemReceiver receiver) { _receiver = receiver; }
public ReadFileCommand(IFileSystemReceiver receiver) { _receiver = receiver; }
public OpenFileCommand(IFileSystemReceiver fs) { this.fileSystem = fs; }
public CloseFileCommand(IFileSystemReceiver receiver) { _receiver = receiver; }
public OpenFileCommand(IFileSystemReceiver receiver) { _receiver = receiver; }