Package com.jcraft.jsch

Examples of com.jcraft.jsch.ChannelExec.disconnect()


        assertEquals(length, buffer.length);
        assertEquals(0, is.read());
        os.write(0);
        os.flush();

        c.disconnect();
        return new String(buffer);
    }

    protected String readDir(String path) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
View Full Code Here


        header = readLine(is);
        assertEquals("E", header);
        os.write(0);
        os.flush();

        c.disconnect();
        return new String(buffer);
    }

    protected String readFileError(String path) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
View Full Code Here

        c.setCommand("scp -f " + path);
        c.connect();
        os.write(0);
        os.flush();
        assertEquals(2, is.read());
        c.disconnect();
        return null;
    }

    protected void sendFile(String path, String name, String data) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
View Full Code Here

        os.flush();
        assertEquals(0, is.read());
        os.write(0);
        os.flush();
        Thread.sleep(100);
        c.disconnect();
    }

    protected void sendFileError(String path, String name, String data) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
        OutputStream os = c.getOutputStream();
View Full Code Here

        c.connect();
        assertEquals(0, is.read());
        os.write(("C7777 "+ data.length() + " " + name + "\n").getBytes());
        os.flush();
        assertEquals(2, is.read());
        c.disconnect();
    }

    protected void sendDir(String path, String dirName, String fileName, String data) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
        OutputStream os = c.getOutputStream();
View Full Code Here

              }
            }
          });
    } finally {
      if (exec.isConnected()) {
        exec.disconnect();
      }
      os.close();
    }
  }
View Full Code Here

              e.printStackTrace();
              return new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1,
                  "DFS operation failed: " + e.getLocalizedMessage(), e);
            } finally {
              if (exec != null) {
                exec.disconnect();
              }
            }
          }
        };
View Full Code Here

            DfsFolder.super.doRefresh();

            return Status.OK_STATUS;
          } finally {
            if (channel.isConnected()) {
              channel.disconnect();
            }
          }
        } catch (Exception e) {
          e.printStackTrace();
          return new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1,
View Full Code Here

                String line = reader.readLine();
                sub.worked(1);
              }

              if (exec.isConnected()) {
                exec.disconnect();
              }

              sub.done();

              monitor.done();
View Full Code Here

                throw new RuntimeException(e);
              } catch (IOException e) {
                throw new RuntimeException(e);
              } finally {
                if (channel.isConnected()) {
                  channel.disconnect();
                }
              }

              monitor.worked(100);
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.