Examples of Shell


Examples of net.schmizz.sshj.connection.channel.direct.Session.Shell

            final Session session = ssh.startSession();
            try {

                session.allocateDefaultPTY();

                final Shell shell = session.startShell();

                new StreamCopier(shell.getInputStream(), System.out)
                        .bufSize(shell.getLocalMaxPacketSize())
                        .spawn("stdout");

                new StreamCopier(shell.getErrorStream(), System.err)
                        .bufSize(shell.getLocalMaxPacketSize())
                        .spawn("stderr");

                // Now make System.in act as stdin. To exit, hit Ctrl+D (since that results in an EOF on System.in)
                // This is kinda messy because java only allows console input after you hit return
                // But this is just an example... a GUI app could implement a proper PTY
                new StreamCopier(System.in, shell.getOutputStream())
                        .bufSize(shell.getRemoteMaxPacketSize())
                        .copy();

            } finally {
                session.close();
            }
View Full Code Here

Examples of net.sf.jftp.tools.Shell

          String str = "";
         
          if(cmd.startsWith("file://")) cmd = cmd.substring(7);
         
          Process p = Runtime.getRuntime().exec(cmd);        
          new Shell(p.getInputStream(), p.getOutputStream());
          
          //while ((str = stdout.readLine()) !=null) {
          //  Log.debug(str);
          //}
         }
View Full Code Here

Examples of org.apache.accumulo.core.util.shell.Shell

      this.cmd = null;
      this.cmdIndex = 0;
      this.readWait = false;
      this.output = new StringBuilderOutputStream();
      ConsoleReader reader = new ConsoleReader(this, new OutputStreamWriter(output, Constants.UTF8));
      this.shell = new Shell(reader, new PrintWriter(new OutputStreamWriter(output, Constants.UTF8)));
      shell.setLogErrorsToConsole();
      if (mock != null) {
        if (shell.config("--fake", "-u", username, "-p", password))
          throw new IOException("mock shell config error");
      } else if (shell.config("-u", username, "-p", password)) {
View Full Code Here

Examples of org.apache.geronimo.gshell.shell.Shell

    public Application getApplication() {
        return application;
    }

    public Shell create() throws Exception {
        final Shell shell = (Shell) applicationContext.getBean("shell");

        log.debug("Created shell instance: {}", shell);

        eventPublisher.publish(new ShellCreatedEvent(shell));
View Full Code Here

Examples of org.apache.hadoop.hbase.Shell

    if (status != Shell.EXIT_FLAG) {
      // throw new ExitException(status);

      // I didn't figure out How can catch the ExitException in shell main.
      // So, I just Re-launching the shell.
      Shell shell = new Shell();

      List<String> argList = new ArrayList<String>();
      argList.add(String.valueOf(Shell.RELAUNCH_FLAG));
      if(Shell.HTML_OPTION != null)
        argList.add(Shell.HTML_OPTION);
      if(Shell.MASTER_ADDRESS != null)
        argList.add(Shell.MASTER_ADDRESS);

      try {
        shell.main(argList.toArray(new String[] {}));
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }
View Full Code Here

Examples of org.codehaus.groovy.tools.shell.Shell

            @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS",justification="Closure invokes this via reflection")
            public Object doCall(Object[] args) {
                assert(args.length == 1);
                assert(args[0] instanceof Shell);

                Shell shell = (Shell)args[0];
                XmlCommandRegistrar r = new XmlCommandRegistrar(shell, cl);
                r.register(GroovyshCommand.class.getResource("commands.xml"));

                return null;
            }
        };
        Groovysh shell = new Groovysh(cl, binding, io, registrar);
        shell.getImports().add("import hudson.model.*");

        // defaultErrorHook doesn't re-throw IOException, so ShellRunner in
        // Groovysh will keep looping forever if we don't terminate when the
        // channel is closed
        final Closure originalErrorHook = shell.getErrorHook();
        shell.setErrorHook(new Closure(shell, shell) {
            private static final long serialVersionUID = 1L;

            @SuppressWarnings("unused")
            @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS",justification="Closure invokes this via reflection")
            public Object doCall(Object[] args) throws ChannelClosedException {
View Full Code Here

Examples of org.crsh.shell.Shell

        Boolean enabled = context.getProperty(WebPlugin.ENABLED);
        if (enabled != null && enabled) {
          log.fine("Using shell " + context);
          ShellFactory factory = context.getPlugin(ShellFactory.class);
          Principal user = wsSession.getUserPrincipal();
          Shell shell = factory.create(user);
          CRaSHSession session = new CRaSHSession(wsSession, shell);
          sessions.put(wsSession.getId(), session);
          log.fine("Established session " + wsSession.getId());
        } else {
          log.fine("Web plugin disabled");
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

        linkCreateNewRuntime.setText("configure WGA distributions");
        linkCreateNewRuntime.addHyperlinkListener(new HyperlinkAdapter() {

            @Override
            public void linkActivated(HyperlinkEvent e) {
                PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(new Shell(), WGADesignerPlugin.PREFERENCES_PAGE_WGA_DEPLOYMENTS, null, null);
                if (pref != null) {
                    pref.open();
                    updateWGADistributions();
                }
            }
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

  /**
   * @see IActionDelegate#run(IAction)
   */
  public void run(IAction action) {
    Shell shell = new Shell();
    MessageDialog.openInformation(
      shell,
      "WGA Designer",
      "New Action was executed.");
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

  Properties _props;
  private IFile _file;

  public void run(IAction action) {

    MessageBox msgBox = new MessageBox(new Shell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
    msgBox.setText("Are you really sure?");
    msgBox.setMessage("Are you really sure that you want to sort the labelfile: \n" + _file.getFullPath());
    int response = msgBox.open();

    if (response == SWT.YES) {
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.