Package org.jnode.shell

Examples of org.jnode.shell.CommandShell.runCommand()


        CommandShell shell = null;
        int ret = 1;
        try {
            shell = (CommandShell) ShellUtils.getShellManager().getCurrentShell();
            long start = System.currentTimeMillis();
            ret = shell.runCommand(sb.toString());
            long end = System.currentTimeMillis();
            out.format(fmt_diff, getRuntime((int) (end - start)));
        } catch (ShellException ex) {
            throw ex;
        } finally {
View Full Code Here


        public void invoke(String command) {
            if (shell != null) {
                if (shell instanceof CommandShell) {
                    CommandShell cs = (CommandShell) shell;
                    try {
                        cs.runCommand(command);
                    } catch (ShellException ex) {
                        System.err.println("Command invocation failed: " + ex.getMessage());
                    }
                } else {
                    System.err.println("Shell wasn't a CommandShell: " + shell.getClass());
View Full Code Here

        for (String arg : spec.getArgs()) {
            sb.append(" ").append(shell.escapeWord(arg));
        }
        int rc;
        try {
            rc = shell.runCommand(sb.toString());
        } catch (Throwable ex) {
            Class<? extends Throwable> exception = spec.getException();
            if (exception != null && exception.isInstance(ex)) {
                rc = 0;
            } else if (ex instanceof Error) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.