パッケージ com.kazurayam.subprocessj
package com.kazurayam.subprocessj
Executes arbitrary OS command in a sub-process, returns an object that includes the return code as int, STDOUT and STDERR as List<String>.
Subprocess
is a simple utility class that wraps
java.lang.ProcessBuilder.
It hides technical complexities of Threading to consume STDOUT and STDERR out of the forked subprocess.
The package is named as "subprocessj" because it is an homage to the Python Subprocess module.
-
クラス説明A HTTP Server that listens to the IP port #8500.killProcessListeningPort(int portNumber) identifies the running process that is listening the IP port #portNumber, get the Process ID, then kill the process.A Data Transfer Object that contains the return code, STDOUT of `lsof -i:port -P` command that reveals how ProcessKiller worked.Subprocess object allows you to spawn new OS subprocess using java.lang.ProcessBuilder.A Data Transfer Object that contains the return code, STDOUT and STDERR out of the executed subprocess.