Remotely executes a command through the rexecd daemon on the server to which the RExecClient is connected. After calling this method, you may interact with the remote process through its standard input, output, and error streams. You will typically be able to detect the termination of the remote process after reaching end of file on its standard output (accessible through {@link #getInputStream getInputStream() }. Disconnecting from the server or closing the process streams before reaching end of file will not necessarily terminate the remote process.
If a separate error stream is requested, the remote server will connect to a local socket opened by RExecClient, providing an independent stream through which standard error will be transmitted. RExecClient will do a simple security check when it accepts a connection for this error stream. If the connection does not originate from the remote server, an IOException will be thrown. This serves as a simple protection against possible hijacking of the error stream by an attacker monitoring the rexec() negotiation. You may disable this behavior with {@link #setRemoteVerificationEnabled setRemoteVerificationEnabled()}.
@param username The account name on the server through which to executethe command.
@param password The plain text password of the user account.
@param command The command, including any arguments, to execute.
@param separateErrorStream True if you would like the standard errorto be transmitted through a different stream than standard output. False if not.
@exception IOException If the rexec() attempt fails. The exceptionwill contain a message indicating the nature of the failure.