Examples of Shell


Examples of org.jboss.aesh.terminal.Shell

        }

        Resource currentWorkingDirectory = commandInvocation.getAeshContext().getCurrentWorkingDirectory();
        for (Resource r : arguments) {

            Shell shell = commandInvocation.getShell();
            Resource resource = r.resolve(currentWorkingDirectory).get(0);
            if (dir) {
                rmDir(resource, commandInvocation);
            } else {
                rmFile(resource, commandInvocation);
View Full Code Here

Examples of org.jboss.forge.addon.shell.Shell

   public void testEscapes() throws Exception
   {
      File tempDir = OperatingSystemUtils.createTempDir();
      tempDir.deleteOnExit();
      DirectoryResource currentResource = resourceFactory.create(DirectoryResource.class, tempDir);
      Shell shell = test.getShell();
      shell.setCurrentResource(currentResource);
      DirectoryResource child = currentResource.getChildDirectory("Forge 2 Escape");
      child.mkdir();
      child.deleteOnExit();
      Result result = test.execute("cd Forge\\ 2\\ Escape", 10, TimeUnit.SECONDS);
      Assert.assertThat(result.getMessage(), CoreMatchers.nullValue());
      Assert.assertEquals(shell.getCurrentResource(), child);
      currentResource.delete(true);
   }
View Full Code Here

Examples of org.jboss.fresh.shell.Shell

      out.close();
      log.debug("CtxDelegateExe done.");
      return;
    }

    Shell shell = getShell();

    PrintWriter err = new PrintWriter(new BufferWriter(getStdOut()));

    for (int i = 0; i < params.length; i++) {

      String tmp = params[i];

      // take parameter 1
      // look up the name through InitialContext
      RegistryContext ctx = new RegistryContext();
      Object obj = null;
      try {
        obj = (Context) ctx.lookup(tmp);
      } catch (Exception ex) {
        if (canThrowEx()) {
          throw new Exception("No object found in JNDI for name: " + tmp);
        } else {
          err.println("No object found in JNDI for name: " + tmp);
          log.debug("CtxDelegateExe done.");
          return;
        }
      }

      // See if what you got is instance of Context

      if (!(obj instanceof Context)) {
        if (canThrowEx()) {
          throw new Exception("Object found in JNDI for name: " + tmp + " is not org.jboss.fresh.ctx.Context type.");
        } else {
          err.println("Object found in JNDI for name: " + tmp + " is not org.jboss.fresh.ctx.Context type.");
          log.debug("CtxDelegateExe done.");
          return;
        }
      }

      Context ctx0 = (Context) obj;
      // now shell.getContext()
      if(log.isDebugEnabled()) {
        log.debug("shell: " + shell + ", ctx: "  + shell.getContext());
      }
      shell.getContext().registerDelegate(ctx0);
      shell.getContext().put("AppContext", ctx0);

      Context gctx = null;
      try {
        tmp = "java:/FRESH/GlobalContext";
        gctx = (Context) ctx.lookup(tmp);
      } catch (Exception ex) {
        if (canThrowEx()) {
          throw new Exception("No object found in JNDI for name: " + tmp);
        } else {
          err.println("No object found in JNDI for name: " + tmp);
          log.debug("CtxDelegateExe done.");
          return;
        }
      }

      shell.getContext().put("GlobalContext", gctx);

      // on context call registerDelegate()
      // done

    }
View Full Code Here

Examples of org.jnode.shell.Shell

    @Override
    public Help getHelp(String alias, CommandInfo cmdInfo) throws HelpException {
        SyntaxBundle syntaxes = null;
        ArgumentBundle bundle = null;
        try {
            final Shell shell = ShellUtils.getShellManager().getCurrentShell();
            final SyntaxManager syntaxManager = shell.getSyntaxManager();
            Command cmd = cmdInfo.createCommandInstance();
            if (cmd != null) {
                bundle = cmd.getArgumentBundle();
                syntaxes = syntaxManager.getSyntaxBundle(alias);
                if (syntaxes == null) {
View Full Code Here

Examples of org.latte.scripting.hostobjects.Shell

        }
      }
    });
    register("thread", new Thread());
    register("sleep", new Sleep());
    register("shell", new Shell());
    register("open", new Open());
    register("hget", new HGet());
    register("hpost", new HPost());
    register("jdbc", new JDBC());
    register("gethostbyaddr", new GetHostByAddr());
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.