X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-ssh%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fssh%2Fthreads%2FIOThread.java;h=b9c9c174dcb3fd10a626c080cca5d75479c3bd62;hb=af3eaa839bf6f6c86495b24d2174eeb6624501c0;hp=33ed88edf839a0d4c6a3f47793acf9baa15f4545;hpb=549b3260a884bf1801d6ea1a0f4ffb7bb5ed2bf5;p=controller.git diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/threads/IOThread.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/threads/IOThread.java index 33ed88edf8..b9c9c174dc 100644 --- a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/threads/IOThread.java +++ b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/threads/IOThread.java @@ -26,6 +26,7 @@ public class IOThread extends Thread { private String id; private ServerSession servSession; private ServerConnection servconnection; + private String customHeader; public IOThread (InputStream is, OutputStream os, String id,ServerSession ss, ServerConnection conn){ @@ -36,11 +37,24 @@ public class IOThread extends Thread { super.setName(id); logger.trace("IOThread {} created", super.getName()); } + public IOThread (InputStream is, OutputStream os, String id,ServerSession ss, ServerConnection conn,String header){ + this.inputStream = is; + this.outputStream = os; + this.servSession = ss; + this.servconnection = conn; + this.customHeader = header; + super.setName(id); + logger.trace("IOThread {} created", super.getName()); + } @Override public void run() { logger.trace("thread {} started", super.getName()); try { + if (this.customHeader!=null && !this.customHeader.equals("")){ + this.outputStream.write(this.customHeader.getBytes()); + logger.trace("adding {} header", this.customHeader); + } IOUtils.copy(this.inputStream, this.outputStream); } catch (Exception e) { logger.error("inputstream -> outputstream copy error ",e);