Examples of openChannel()


Examples of com.jcraft.jsch.Session.openChannel()

           
            // trying to connect ...
            session.connect();       
           
            String command="scp -p -t " + remoteName;
            final Channel channel = session.openChannel("exec");
            ((ChannelExec)channel).setCommand(command);       
           
            // get I/O streams for remote scp
            final OutputStream out=channel.getOutputStream();
            final InputStream in=channel.getInputStream();
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

            long sessionEnd = System.currentTimeMillis();
            YSLOG.info("I00002", user, host, port, privateKey, sessionEnd - sessionStart);

            int exitStatus;
            try {
                ChannelExec channel = (ChannelExec) session.openChannel("exec");
                channel.setCommand(buildCommand(commandLineTokens, environmentVariables));
                channel.setInputStream(new ByteArrayInputStream(new byte[0]), true);
                channel.setOutputStream(output, true);
                channel.setErrStream(output, true);
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

            {
            }
        });
        session.setPassword(pass);
        session.connect();
        ChannelSftp chan = (ChannelSftp) session.openChannel("sftp");
        chan.connect();
        Vector<?> list = chan.ls(dir);
        Iterator<?> iterList = list.iterator();
        while (iterList.hasNext())
        {
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

            public void showMessage(String string) {
            }
        });
        session.connect();
        final ChannelSftp channel = (ChannelSftp) session.openChannel("sftp");
        channel.connect();
        return channel;
    }
}
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

        Session session = getSession(pathOrUri);
        String host = session.getHost();
        ChannelSftp channel = SshCache.getInstance().getChannelSftp(session);
        if (channel == null) {
            try {
                channel = (ChannelSftp) session.openChannel("sftp");
                channel.connect();
                Message.verbose(":: SFTP :: connected to " + host + "!");
                SshCache.getInstance().attachChannelSftp(session, channel);
            } catch (JSchException e) {
                IOException ex = new IOException(e.getMessage());
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

                channel = idleChannel;
                idleChannel = null;
            }
            else
            {
                channel = (ChannelSftp) session.openChannel("sftp");
                channel.connect();

                Boolean userDirIsRoot = SftpFileSystemConfigBuilder.getInstance().getUserDirIsRoot(getFileSystemOptions());
                String workingDirectory = getRootName().getPath();
                if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue()))
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

        }

        // exec 'scp -t -p hadoop.jar' remotely

        String command = "scp -p -t " + remoteFile;
        Channel channel = session.openChannel("exec");
        ((ChannelExec) channel).setCommand(command);

        // get I/O streams for remote scp
        OutputStream out = channel.getOutputStream();
        final InputStream in = channel.getInputStream();
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

        // move the jar file to a temp directory
        String jarDir = "/tmp/hadoopjar"
            + new VMID().toString().replace(':', '_');
        command = "mkdir " + jarDir + ";mv " + remoteFile + " " + jarDir;
        channel = session.openChannel("exec");
        ((ChannelExec) channel).setCommand(command);
        channel.connect();
        channel.disconnect();

        session.disconnect();
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

          try {
            Session session = server.createSession();

            String command =
                server.getInstallPath() + "/bin/hadoop job -kill " + jobId;
            Channel channel = session.openChannel("exec");
            ((ChannelExec) channel).setCommand(command);
            channel.connect();
            channel.disconnect();

            session.disconnect();
View Full Code Here

Examples of com.jcraft.jsch.Session.openChannel()

            Session session = null;
            try {
              session = location.createSession();
              try {
                ChannelExec channel =
                    (ChannelExec) session.openChannel("exec");
                channel.setCommand(location.getInstallPath()
                    + "/bin/hadoop version");
                BufferedReader response =
                    new BufferedReader(new InputStreamReader(channel
                        .getInputStream()));
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.