@Override public void handleWindowAdjust(Buffer buffer) throws IOException { super.handleWindowAdjust(buffer); if (asyncIn != null) { asyncIn.onWindowExpanded(); } }
@Override public void write(int i) throws IOException { synchronized (b) { b[0] = (byte) i; write(b, 0, 1); } }
@Override protected void doOpen() throws IOException { if (streaming == Streaming.Async) { asyncIn = new ChannelAsyncOutputStream(this, SshConstants.SSH_MSG_CHANNEL_DATA); asyncOut = new ChannelAsyncInputStream(this); } else { out = new ChannelOutputStream(this, getRemoteWindow(), log, SshConstants.SSH_MSG_CHANNEL_DATA, true); invertedIn = out; ChannelPipedInputStream pis = new ChannelPipedInputStream(this, getLocalWindow()); pipe = new ChannelPipedOutputStream(pis); in = pis; invertedOut = in; } }
@Override public void setIoOutputStream(IoOutputStream out) { this.out = new BufferedIoOutputStream("sftp out buffer", out); }
@Override public Throwable getException() { Object v = getValue(); if (v instanceof Throwable) { return (Throwable) v; } else { return null; } } }
protected void signalChannelOpenFailure(ChannelListener listener, Throwable reason) { if (listener == null) { return; } listener.channelOpenFailure(this, reason); }
protected void notifyStateChanged(ChannelListener listener, String hint) { if (listener == null) { return; } listener.channelStateChanged(this, hint); }
@Override public synchronized void write(int w) throws IOException { b[0] = (byte) w; write(b, 0, 1); }
@Override public void close() throws IOException { in.close(false); } }
protected void signalChannelInitialized(ChannelListener listener) { if (listener == null) { return; } listener.channelInitialized(this); }
protected void signalChannelOpenSuccess(ChannelListener listener) { if (listener == null) { return; } listener.channelOpenSuccess(this); }
@Override default <T> T resolveAttribute(AttributeRepository.AttributeKey<T> key) { return resolveAttribute(this, key); }
@Override public Command create() { return new TestEchoShell(); } }
@Override public void setOutputStream(OutputStream out) { this.out = out; if (out instanceof ChannelOutputStream) { ((ChannelOutputStream) out).setNoDelay(true); } }
@Override protected void doOpen() throws IOException { if (streaming == Streaming.Async) { asyncIn = new ChannelAsyncOutputStream(this, SshConstants.SSH_MSG_CHANNEL_DATA); asyncOut = new ChannelAsyncInputStream(this); } else { out = new ChannelOutputStream(this, getRemoteWindow(), log, SshConstants.SSH_MSG_CHANNEL_DATA, true); invertedIn = out; ChannelPipedInputStream pis = new ChannelPipedInputStream(this, getLocalWindow()); pipe = new ChannelPipedOutputStream(pis); in = pis; invertedOut = in; } }
@Override public void handleWindowAdjust(Buffer buffer) throws IOException { super.handleWindowAdjust(buffer); if (asyncIn != null) { asyncIn.onWindowExpanded(); } }
@Override public Throwable getException() { Object v = getValue(); if (v instanceof Throwable) { return (Throwable) v; } else { return null; } } }