Example usage for org.apache.commons.lang SystemUtils IS_OS_HP_UX

List of usage examples for org.apache.commons.lang SystemUtils IS_OS_HP_UX

Introduction

In this page you can find the example usage for org.apache.commons.lang SystemUtils IS_OS_HP_UX.

Prototype

boolean IS_OS_HP_UX

To view the source code for org.apache.commons.lang SystemUtils IS_OS_HP_UX.

Click Source Link

Document

Is true if this is HP-UX.

The field will return false if OS_NAME is null.

Usage

From source file:org.jboss.qa.jcontainer.util.executor.ProcessExecutor.java

public Process asyncExecute() throws IOException {
    if (processBuilder == null) {
        processBuilder = new ProcessBuilder(commands);
    }//from  www  .  j  av a 2s. c  om

    if (outputStream == null) {
        if (SystemUtils.IS_OS_HP_UX) {
            outputStream = System.out;
        } else {
            processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
        }
    }
    if (errorStream == null && !redirectError) {
        if (SystemUtils.IS_OS_HP_UX) {
            outputStream = System.err;
        } else {
            processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
        }
    }
    processBuilder.redirectErrorStream(redirectError);

    final Process process = processBuilder.start();

    final ExecutorService executeService = Executors.newCachedThreadPool();
    final List<Future> futures = new ArrayList<>();

    if (outputStream != null) {
        final Pipe pipe = Pipe.open();
        futures.add(executeService
                .submit(new CopyIntoChannel(Channels.newChannel(process.getInputStream()), pipe.sink())));
        futures.add(
                executeService.submit(new CopyIntoChannel(pipe.source(), Channels.newChannel(outputStream))));
    }
    if (errorStream != null && !redirectError) {
        final Pipe pipe = Pipe.open();
        futures.add(executeService
                .submit(new CopyIntoChannel(Channels.newChannel(process.getErrorStream()), pipe.sink())));
        futures.add(
                executeService.submit(new CopyIntoChannel(pipe.source(), Channels.newChannel(errorStream))));
    }

    final Future<Integer> future = executeService.submit(new Callable<Integer>() {
        @Override
        public Integer call() throws Exception {
            process.waitFor();
            for (Future f : futures) {
                f.get();
            }
            return process.exitValue();
        }
    });

    final Process proxyProcess = new ProcessWrapper(process, future);

    executeService.shutdown();
    return proxyProcess;
}

From source file:util.PosixComplianceUtil.java

private boolean isFullyPosixCompliant() {
    return SystemUtils.IS_OS_AIX || SystemUtils.IS_OS_HP_UX || SystemUtils.IS_OS_IRIX
            || SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_SOLARIS;
}