private void initRshModeServer() throws ConnectionException { try { String[] command = new String[] { Server.isRunningOnWindows() ? "cmd.exe" : "/bin/sh", Server.isRunningOnWindows() ? "/c" : "-c", rsh }; ProcessBuilder builder = new ProcessBuilder(command); // builder.redirectErrorStream(true); // redirect error stream to // output stream Process process = builder.start(); InputStream in = process.getInputStream(); OutputStream out = process.getOutputStream(); // InputStream err = process.getErrorStream(); inputStream = new RpcRshInputStream(in, stats); outputStream = new RpcRshOutputStream(out, stats); } catch (Throwable thr) { Log.error("Unexpected exception: %s", thr.getLocalizedMessage()); Log.exception(thr); throwConnectionException(thr); } }
void initRshModeServer() throws ConnectionException { try { String[] command = new String[] { Server.isRunningOnWindows() ? "cmd.exe" : "/bin/sh", Server.isRunningOnWindows() ? "/c" : "-c", rsh }; ProcessBuilder builder = new ProcessBuilder(command); // builder.redirectErrorStream(true); // redirect error stream to // output stream Process process = builder.start(); InputStream in = process.getInputStream(); OutputStream out = process.getOutputStream(); // InputStream err = process.getErrorStream(); inputStream = new RpcRshInputStream(in, stats); outputStream = new RpcRshOutputStream(out, stats); // p4ic4idea: never, never, never catch a Throwable, // unless you're really careful, which this is not. // } catch (Throwable thr) { } catch (Exception thr) { Log.error("Unexpected exception: %s", thr.getLocalizedMessage()); Log.exception(thr); throwConnectionException(thr); } }
if (!Server.isRunningOnWindows()) { try { String absoPath = file.getAbsolutePath();
if (!Server.isRunningOnWindows()) { try { String absoPath = file.getAbsolutePath();