package samples.ui.actions; import org.eclipse.rse.files.ui.actions.SystemAbstractRemoteFilePopupMenuExtensionAction; import com.ibm.etools.systems.subsystems.*; /** * An action that runs a command to display the contents of a Jar file. * The plugin.xml file restricts this action so it only appears for .jar files. */ public class ShowJarContents extends SystemAbstractRemoteFilePopupMenuExtensionAction { /** * Constructor for ShowJarContents. */ public ShowJarContents() { super(); } /** * @see org.eclipse.rse.ui.actions.SystemAbstractPopupMenuExtensionAction#run() */ public void run() { IRemoteFile selectedFile = getFirstSelectedRemoteFile(); String cmdToRun = "jar -tvf " + selectedFile.getAbsolutePath(); runCommand(cmdToRun); } }