Example usage for java.util.regex Pattern splitAsStream

List of usage examples for java.util.regex Pattern splitAsStream

Introduction

In this page you can find the example usage for java.util.regex Pattern splitAsStream.

Prototype

public Stream<String> splitAsStream(final CharSequence input) 

Source Link

Document

Creates a stream from the given input sequence around matches of this pattern.

Usage

From source file:org.zanata.sync.jobs.system.ResourceProducer.java

private static boolean isGitExecutableOnPath() {
    String tryNativeGit = System.getenv(TRY_NATIVE_GIT);
    if (Boolean.parseBoolean(tryNativeGit)) {
        Pattern pattern = Pattern.compile(Pattern.quote(File.pathSeparator));
        return pattern.splitAsStream(System.getenv("PATH")).map(Paths::get)
                .anyMatch(path -> Files.exists(path.resolve("git")));
    }//from   w  ww .  jav a 2 s  . c  o m
    return false;
}