apache-commons-exec

How to pipe a string argument to an executable launched with Apache Commons Exec?

余生长醉 提交于 2019-11-29 03:54:12
I need to pipe a text argument to the stdin of a command launched with Apache Commons Exec (for the curious, the command is gpg and the argument is the passphrase to the keystore; gpg does not have an argument to provide the passphrase explicitly, only to accept it from stdin). In addition, I need this to support both Linux and Windows. In a shell script I'd do cat mypassphrase|gpg --passphrase-fd or type mypassphrase|gpg --passphrase-fd but type doesn't work on Windows as it's not an executable but a command built into the command interpreted (cmd.exe). The code not working (for the above

Process output from apache-commons exec

北慕城南 提交于 2019-11-28 10:42:46
I am at my wits end here. I'm sure this is something simple and I most likely have huge holes in my understanding of java and streams. I think there are so many classes that I'm a bit overwhelmed with trying to poke through the API to figure out when and how I want to use the multitude of input/output streams. I just learned about the existence of the apache commons library (self teaching java fail), and am currently trying to convert some of my Runtime.getRuntime().exec to use the commons - exec. Already it's fixed some of the once every 6 months this problem crops up then goes away style

Process output from apache-commons exec

余生长醉 提交于 2019-11-27 03:45:32
问题 I am at my wits end here. I'm sure this is something simple and I most likely have huge holes in my understanding of java and streams. I think there are so many classes that I'm a bit overwhelmed with trying to poke through the API to figure out when and how I want to use the multitude of input/output streams. I just learned about the existence of the apache commons library (self teaching java fail), and am currently trying to convert some of my Runtime.getRuntime().exec to use the commons -