mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goldstein Lyor (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SSHD-677) Provide a quick default implementation for executing a single simple command that does not require any input
Date Thu, 14 Jul 2016 04:37:20 GMT
Goldstein Lyor created SSHD-677:
-----------------------------------

             Summary: Provide a quick default implementation for executing a single simple
command that does not require any input
                 Key: SSHD-677
                 URL: https://issues.apache.org/jira/browse/SSHD-677
             Project: MINA SSHD
          Issue Type: Improvement
    Affects Versions: 1.3.0
            Reporter: Goldstein Lyor
            Assignee: Goldstein Lyor
             Fix For: 1.3.0


{code:java}
default String executeCommand(String cmd) throws IOException {
     ...invoke method below + throw IOException if anything written to stderr...
}

default String executeCommand(String cmd, Appendable stderr /* ignored if null */) throws
IOException {
    StringBuilder result = new StringBuilder(Byte.MAX_VALUE);
    executeCommand(cmd, result, stderr);
    return result.toString();
}

default void executeCommand(String cmd, Appendable stdout /* ignored if null */, Appendable
stderr /* ignored if null */) throws IOException {
    ....throw exception if any input is required...
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message