- Timestamp:
- 2017-04-07T18:53:23+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/util/SafeProcess.java
r31593 r31594 116 116 117 117 // http://stackoverflow.com/questions/5283444/convert-array-of-strings-into-a-string-in-java 118 ///System.err.println("SafeProcess running: " + Arrays.toString(command_args)); 118 System.err.println("SafeProcess running: " + Arrays.toString(command_args)); 119 ///logger.info("SafeProcess running: " + Arrays.toString(command_args)); 119 120 120 121 if(this.envp == null) { … … 123 124 124 125 if(this.dir == null) { 126 ///logger.info("\twith: " + Arrays.toString(this.envp)); 125 127 ///System.err.println("\twith: " + Arrays.toString(this.envp)); 126 128 prcs = rt.exec(this.command_args, this.envp); 127 129 } else { 128 //System.err.println("\tfrom directory: " + this.dir); 129 //System.err.println("\twith: " + Arrays.toString(this.envp)); 130 ///logger.info("\tfrom directory: " + this.dir); 131 ///logger.info("\twith: " + Arrays.toString(this.envp)); 132 ///System.err.println("\tfrom directory: " + this.dir); 133 ///System.err.println("\twith: " + Arrays.toString(this.envp)); 130 134 prcs = rt.exec(this.command_args, this.envp, this.dir); 131 135 } … … 265 269 } 266 270 267 // write your own run() body for any StreamGobbler 271 // Write your own run() body for any StreamGobbler. You need to create an instance of a class 272 // implementing CustomProcessHandler for EACH IOSTREAM of the process that you want to handle. 273 // Do not create a single CustomProcessHandler instance and reuse it for all three streams, 274 // i.e. don't call SafeProcess' runProcess(x, x, x); It should be runProcess(x, y, z). 268 275 // Make sure your implementation is threadsafe if you're sharing immutable objects between the threaded streams 269 276 // example implementation is in the GS2PerlConstructor.SynchronizedProcessHandler class.
Note:
See TracChangeset
for help on using the changeset viewer.