Process Warden - Finalized Process

A wrapper for Process/ProcessBuilder that helps to avoid some of the pitfalls of using them directly.

License

License

GroupId

GroupId

com.leacox.process
ArtifactId

ArtifactId

process-warden
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Process Warden - Finalized Process
A wrapper for Process/ProcessBuilder that helps to avoid some of the pitfalls of using them directly.
Project URL

Project URL

https://github.com/johnlcox/process-warden
Source Code Management

Source Code Management

https://github.com/johnlcox/process-warden

Download process-warden

How to add to project

<!-- https://jarcasting.com/artifacts/com.leacox.process/process-warden/ -->
<dependency>
    <groupId>com.leacox.process</groupId>
    <artifactId>process-warden</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.leacox.process/process-warden/
implementation 'com.leacox.process:process-warden:1.1.0'
// https://jarcasting.com/artifacts/com.leacox.process/process-warden/
implementation ("com.leacox.process:process-warden:1.1.0")
'com.leacox.process:process-warden:jar:1.1.0'
<dependency org="com.leacox.process" name="process-warden" rev="1.1.0">
  <artifact name="process-warden" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.leacox.process', module='process-warden', version='1.1.0')
)
libraryDependencies += "com.leacox.process" % "process-warden" % "1.1.0"
[com.leacox.process/process-warden "1.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.5

test (4)

Group / Artifact Type Version
junit : junit jar 4.11
org.mockito : mockito-all jar 1.9.5
org.powermock : powermock-module-junit4 jar 1.5
org.powermock : powermock-api-mockito jar 1.5

Project Modules

There are no modules declared in this project.

process-warden

Build Status

process-warden provides a safer wrapper around the built in Java Process and ProcessBuilder classes for executing native subprocesses.

Usage

With Java 6:

FinalizedProcessBuilder pb = new FinalizedProcessBuilder("myCommand", "myArg");
FinalizedProcess process = pb.start();
try {
  int returnVal = process.waitFor(5000);
} finally {
  process.close();
}

With Java 7 and try-with-resources:

FinalizedProcessBuilder pb = new FinalizedProcessBuilder("myCommand", "myArg");
try (FinalizedProcess process = pb.start()) {
  int returnVal = process.waitFor(5000);
}

Now With Stream Gobbling. The StreamGobbler will gobble up the input stream, error stream, or both in a separate thread to prevent from blocking your thread.

FinalizedProcessBuilder pb = new FinalizedProcessBuilder("myCommand", "myArg");
pb.gobbleStreams(true);
try (FinalizedProcess process = pb.start()) {
  int returnVal = process.waitFor(5000);
}

Installation

Add it as a maven dependency:

<dependency>
  <groupId>com.leacox.process</groupId>
  <artifactId>process-warden</artifactId>
  <version>1.1.0</version>
</dependency>

License

Copyright 2013 John Leacox

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Version
1.1.0
1.0.0