com.mucommander.shell
Class Shell

java.lang.Object
  extended by com.mucommander.shell.Shell
All Implemented Interfaces:
ConfigurationListener

public class Shell
extends java.lang.Object
implements ConfigurationListener

Used to execute shell commands.

Author:
Maxence Bernard, Nicolas Rinaudo

Method Summary
 void configurationChanged(ConfigurationEvent event)
          Reacts to configuration changes.
static AbstractProcess execute(java.lang.String command, AbstractFile currentFolder)
          Executes the specified command in the specified folder.
static AbstractProcess execute(java.lang.String command, AbstractFile currentFolder, ProcessListener listener)
          Executes the specified command in the specified folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public static AbstractProcess execute(java.lang.String command,
                                      AbstractFile currentFolder)
                               throws java.io.IOException
Executes the specified command in the specified folder.

The currentFolder folder parameter will only be used if it's neither a remote directory nor an archive. Otherwise, the command will run from the user's home directory.

Parameters:
command - command to run.
currentFolder - where to run the command from.
Returns:
the resulting process.
Throws:
java.io.IOException - thrown if any error occurs while trying to run the command.

execute

public static AbstractProcess execute(java.lang.String command,
                                      AbstractFile currentFolder,
                                      ProcessListener listener)
                               throws java.io.IOException
Executes the specified command in the specified folder.

The currentFolder folder parameter will only be used if it's neither a remote directory nor an archive. Otherwise, the command will run from the user's home directory.

Information about the resulting process will be sent to the specified listener.

Parameters:
command - command to run.
currentFolder - where to run the command from.
listener - where to send information about the resulting process.
Returns:
the resulting process.
Throws:
java.io.IOException - thrown if any error occurs while trying to run the command.

configurationChanged

public void configurationChanged(ConfigurationEvent event)
Reacts to configuration changes.

Specified by:
configurationChanged in interface ConfigurationListener
Parameters:
event - describes the configuration modification.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard