Examples of ShellException


Examples of org.jboss.fresh.shell.ShellException

  public ProcessInfo execute(String cmdline, List input) throws ShellException {
    collide();
    try {
      return shell.execute(cmdline, input);
    } catch(RemoteException ex) {
      throw new ShellException(ex);
    } finally {
      done();
    }
  }
View Full Code Here

Examples of org.jboss.fresh.shell.ShellException

  public Object executeAsObject(String cmdline) throws ShellException {
    collide();
    try {
      return shell.executeAsObject(cmdline);
    } catch(RemoteException ex) {
      throw new ShellException(ex);
    } finally {
      done();
    }
  }
View Full Code Here

Examples of org.jboss.fresh.shell.ShellException

  public Object executeAsObject(String cmdline, List input) throws ShellException {
    collide();
    try {
      return shell.executeAsObject(cmdline, input);
    } catch(RemoteException ex) {
      throw new ShellException(ex);
    } finally {
      done();
    }
  }
View Full Code Here

Examples of org.jboss.fresh.shell.ShellException

  public String getEnvProperty(String propname) throws ShellException {
    collide();
    try {
      return shell.getEnvProperty(propname);
    } catch(RemoteException ex) {
      throw new ShellException(ex);
    } finally {
      done();
    }
  }
View Full Code Here

Examples of org.jboss.fresh.shell.ShellException

  public void setEnvProperty(String name, String value) throws ShellException {
    collide();
    try {
      shell.setEnvProperty(name, value);
    } catch(RemoteException ex) {
      throw new ShellException(ex);
    } finally {
      done();
    }
  }
View Full Code Here

Examples of org.jboss.fresh.shell.ShellException

  public void close() throws ShellException {
    collide();
    try {
      shell.remove();
    } catch(Exception ex) {
      throw new ShellException(ex);
    } finally {
      done();
    }
  }
View Full Code Here

Examples of org.jboss.fresh.shell.ShellException

  public String getSessionID() throws ShellException {
    collide();
    try {
      return shell.getSessionID();
    } catch(RemoteException ex) {
      throw new ShellException(ex);
    } finally {
      done();
    }
  }
View Full Code Here

Examples of org.jboss.fresh.shell.ShellException

  public void using() throws ShellException {
    collide();
    try {
      shell.getSessionID();
    } catch(RemoteException ex) {
      throw new ShellException(ex);
    } finally {
      done();
    }
  }
View Full Code Here

Examples of org.jboss.fresh.shell.ShellException

                        ex.printStackTrace(pwout);
                        return;
                    }
                } catch (Throwable t) {
                    //log.error(t.getMessage(), t);
                    ShellException ex = new ShellException(t);

                    if (canThrowEx()) {
                        throw ex;
                    } else {
                        ex.printStackTrace(pwout);
                        return;
                    }
                }
            }
View Full Code Here

Examples of org.jnode.shell.ShellException

                    case REDIR_GREAT:
                        try {
                            File file = new File(redir.getArg().getText());
                            if (isNoClobber() && file.exists()) {
                                throw new ShellException("File already exists");
                            }
                            out = new CommandOutput(new FileOutputStream(file));
                            stream = new CommandIOHolder(out, true);
                        } catch (IOException ex) {
                            throw new ShellException("Cannot open output file", ex);
                        }
                        break;

                    case REDIR_CLOBBER:
                    case REDIR_DGREAT:
                        try {
                            FileOutputStream tmp = new FileOutputStream(redir.getArg().getText(),
                                    redir.getRedirectionType() == REDIR_DGREAT);
                            stream = new CommandIOHolder(new CommandOutput(tmp), true);
                        } catch (IOException ex) {
                            throw new ShellException("Cannot open output file", ex);
                        }
                        break;

                    case REDIR_LESS:
                        try {
                            File file = new File(redir.getArg().getText());
                            in = new CommandInput(new FileInputStream(file));
                            stream = new CommandIOHolder(in, true);
                        } catch (IOException ex) {
                            throw new ShellException("Cannot open input file", ex);
                        }
                        break;

                    case REDIR_LESSAND:
                        try {
                            int fromFd = Integer.parseInt(redir.getArg().getText());
                            stream = (fromFd >= holders.length) ? null :
                                    new CommandIOHolder(holders[fromFd]);
                        } catch (NumberFormatException ex) {
                            throw new ShellException("Invalid fd after <&");
                        }
                        break;

                    case REDIR_GREATAND:
                        try {
                            int fromFd = Integer.parseInt(redir.getArg().getText());
                            stream = (fromFd >= holders.length) ? null :
                                    new CommandIOHolder(holders[fromFd]);
                        } catch (NumberFormatException ex) {
                            throw new ShellException("Invalid fd after >&");
                        }
                        break;

                    case REDIR_LESSGREAT:
                        throw new UnsupportedOperationException("<>");
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.