Class Channel

java.lang.Object
com.jcraft.jsch.Channel
Direct Known Subclasses:
ChannelDirectTCPIP, ChannelExec, ChannelForwardedTCPIP, ChannelSftp, ChannelShell, ChannelSubsystem

public abstract class Channel extends Object
  • Field Details

    • type

      protected byte[] type
    • session

      protected Session session
  • Method Details

    • connect

      public void connect() throws JSchException
      Throws:
      JSchException
    • connect

      public void connect(int connectTimeout) throws JSchException
      Throws:
      JSchException
    • setXForwarding

      public void setXForwarding(boolean foo)
    • start

      public void start() throws JSchException
      Throws:
      JSchException
    • isEOF

      public boolean isEOF()
    • setInputStream

      public void setInputStream(InputStream in)
    • setInputStream

      public void setInputStream(InputStream in, boolean dontclose)
    • setOutputStream

      public void setOutputStream(OutputStream out)
    • setOutputStream

      public void setOutputStream(OutputStream out, boolean dontclose)
    • setExtOutputStream

      public void setExtOutputStream(OutputStream out)
    • setExtOutputStream

      public void setExtOutputStream(OutputStream out, boolean dontclose)
    • getInputStream

      public InputStream getInputStream() throws IOException
      Throws:
      IOException
    • getExtInputStream

      public InputStream getExtInputStream() throws IOException
      Throws:
      IOException
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Throws:
      IOException
    • setLocalWindowSizeMax

      public void setLocalWindowSizeMax(int size) throws JSchException
      Sets the maximum local window size.

      Both the maximum local window size and the initial local window size are set to the specified size.

      Parameters:
      size - the maximum local window size in bytes
      Throws:
      JSchException - if the channel is already connected or if size is not positive
    • getLocalWindowSizeMax

      public int getLocalWindowSizeMax()
      Gets the maximum local window size.
      Returns:
      the maximum local window size in bytes
    • setLocalPacketSize

      public void setLocalPacketSize(int size) throws JSchException
      Sets the maximum local packet size.
      Parameters:
      size - the maximum local packet size in bytes
      Throws:
      JSchException - if the channel is already connected, if size is not positive, or if size exceeds the maximum allowed packet size
    • getLocalPacketSize

      public int getLocalPacketSize()
      Gets the maximum local packet size.
      Returns:
      the maximum local packet size in bytes
    • isClosed

      public boolean isClosed()
    • disconnect

      public void disconnect()
    • isConnected

      public boolean isConnected()
    • sendSignal

      public void sendSignal(String signal) throws Exception
      Throws:
      Exception
    • getExitStatus

      public int getExitStatus()
    • getExitSignal

      public String getExitSignal()
    • getSession

      public Session getSession() throws JSchException
      Throws:
      JSchException
    • getId

      public int getId()
    • sendOpenConfirmation

      protected void sendOpenConfirmation() throws Exception
      Throws:
      Exception
    • sendOpenFailure

      protected void sendOpenFailure(int reasoncode)
    • genChannelOpenPacket

      protected com.jcraft.jsch.Packet genChannelOpenPacket()
    • sendChannelOpen

      protected void sendChannelOpen() throws Exception
      Throws:
      Exception