comparison app/src/main/java/ch/ethz/ssh2/channel/ServerSessionImpl.java @ 438:d29cce60f393

migrate from Eclipse to Android Studio
author Carl Byington <carl@five-ten-sg.com>
date Thu, 03 Dec 2015 11:23:55 -0800
parents src/ch/ethz/ssh2/channel/ServerSessionImpl.java@071eccdff8ea
children
comparison
equal deleted inserted replaced
437:208b31032318 438:d29cce60f393
1
2 package ch.ethz.ssh2.channel;
3
4 import java.io.IOException;
5 import java.io.InputStream;
6 import java.io.OutputStream;
7
8 import ch.ethz.ssh2.ServerSession;
9 import ch.ethz.ssh2.ServerSessionCallback;
10
11 public class ServerSessionImpl implements ServerSession {
12 Channel c;
13 public ServerSessionCallback sscb;
14
15 public ServerSessionImpl(Channel c) {
16 this.c = c;
17 }
18
19 public int getState() {
20 return c.getState();
21 }
22
23 public InputStream getStdout() {
24 return c.getStdoutStream();
25 }
26
27 public InputStream getStderr() {
28 return c.getStderrStream();
29 }
30
31 public OutputStream getStdin() {
32 return c.getStdinStream();
33 }
34
35 public void close() {
36 try {
37 c.cm.closeChannel(c, "Closed due to server request", true);
38 }
39 catch (IOException ignored) {
40 }
41 }
42
43 public synchronized ServerSessionCallback getServerSessionCallback() {
44 return sscb;
45 }
46
47 public synchronized void setServerSessionCallback(ServerSessionCallback sscb) {
48 this.sscb = sscb;
49 }
50 }