superduong / commons-net-ssh

Automatically exported from code.google.com/p/commons-net-ssh
Apache License 2.0
0 stars 0 forks source link

Wrap getInputStream() for the user #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice if we could somehow wrap the following loop up for the user:

BufferedReader br = new BufferedReader(new
InputStreamReader(cmd.getInputStream()));
            String line;
            while ((line = br.readLine()) != null)
                System.out.print(line);

and maybe provide them with an easy way of getting the command output.
Although it may be beneficial to also allow them access to the InputStream
as well..

Original issue reported on code.google.com by rory.win...@gmail.com on 27 Jul 2009 at 12:19

GoogleCodeExporter commented 9 years ago
Nice idea! Fixed in r114
(http://code.google.com/p/commons-net-ssh/source/diff?spec=svn114&r=114&format=s
ide&path=/src/main/java/org/apache/commons/net/ssh/connection/SessionChannel.jav
a);
example updated

Original comment by shik...@gmail.com on 27 Jul 2009 at 1:13