git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated coding rules.
[utils]
/
support
/
general
/
src
/
main
/
java
/
org
/
wamblee
/
io
/
SimpleProcess.java
diff --git
a/support/general/src/main/java/org/wamblee/io/SimpleProcess.java
b/support/general/src/main/java/org/wamblee/io/SimpleProcess.java
index d4f7b16b9def2a825d15ed2fb6924e692f54afb3..744386445d15c1e7d6fa1ce63876e712c55f5100 100644
(file)
--- a/
support/general/src/main/java/org/wamblee/io/SimpleProcess.java
+++ b/
support/general/src/main/java/org/wamblee/io/SimpleProcess.java
@@
-32,30
+32,30
@@
public class SimpleProcess {
private static final Log LOG = LogFactory.getLog(SimpleProcess.class);
private static final Log LOG = LogFactory.getLog(SimpleProcess.class);
- private File
_
directory;
+ private File directory;
- private String[]
_
cmd;
+ private String[] cmd;
- private String
_
stdout;
- private String
_
stderr;
+ private String stdout;
+ private String stderr;
public SimpleProcess(File aDirectory, String[] aCmd) {
public SimpleProcess(File aDirectory, String[] aCmd) {
-
_
directory = aDirectory;
-
_
cmd = aCmd;
+ directory = aDirectory;
+ cmd = aCmd;
}
/**
* @return the stdout
*/
public String getStdout() {
}
/**
* @return the stdout
*/
public String getStdout() {
- return
_
stdout;
+ return stdout;
}
/**
* @return the stderr
*/
public String getStderr() {
}
/**
* @return the stderr
*/
public String getStderr() {
- return
_
stderr;
+ return stderr;
}
/**
}
/**
@@
-72,22
+72,22
@@
public class SimpleProcess {
private int runImpl() throws IOException {
try {
String fullcmd = "";
private int runImpl() throws IOException {
try {
String fullcmd = "";
- for (String part:
_
cmd) {
+ for (String part: cmd) {
fullcmd += " " + part;
}
fullcmd += " " + part;
}
- LOG.debug("Executing '" + fullcmd + "' in directory '" +
_
directory
+ LOG.debug("Executing '" + fullcmd + "' in directory '" + directory
+ "'");
+ "'");
- java.lang.Process proc = Runtime.getRuntime().exec(
_cmd, null, _
directory);
+ java.lang.Process proc = Runtime.getRuntime().exec(
cmd, null,
directory);
// Read standard output and error in separate threads to avoid
// deadlock.
// Read standard output and error in separate threads to avoid
// deadlock.
- StringWriter
s
tdout = new StringWriter();
- StringWriter
s
tderr = new StringWriter();
+ StringWriter
myS
tdout = new StringWriter();
+ StringWriter
myS
tderr = new StringWriter();
Thread stdoutReader = readAndLogStream("STDOUT> ", proc
Thread stdoutReader = readAndLogStream("STDOUT> ", proc
- .getInputStream(),
s
tdout);
+ .getInputStream(),
myS
tdout);
Thread stderrReader = readAndLogStream("STDERR> ", proc
Thread stderrReader = readAndLogStream("STDERR> ", proc
- .getErrorStream(),
s
tderr);
+ .getErrorStream(),
myS
tderr);
try {
proc.waitFor();
try {
proc.waitFor();
@@
-100,8
+100,8
@@
public class SimpleProcess {
waitForReader(stdoutReader);
waitForReader(stderrReader);
waitForReader(stdoutReader);
waitForReader(stderrReader);
-
_stdout = s
tdout.toString();
-
_stderr = s
tderr.toString();
+
stdout = myS
tdout.toString();
+
stderr = myS
tderr.toString();
if (proc.exitValue() != 0) {
LOG.warn("Exit value was non-zero: " + this);
if (proc.exitValue() != 0) {
LOG.warn("Exit value was non-zero: " + this);
@@
-160,9
+160,9
@@
public class SimpleProcess {
@Override
public String toString() {
String fullcmd = "";
@Override
public String toString() {
String fullcmd = "";
- for (String part:
_
cmd) {
+ for (String part: cmd) {
fullcmd += part + " ";
}
fullcmd += part + " ";
}
- return "process(dir = '" +
_
directory + "', cmd = '" + fullcmd + "')";
+ return "process(dir = '" + directory + "', cmd = '" + fullcmd + "')";
}
}
}
}