List of usage examples for java.util.regex Pattern splitAsStream
public Stream<String> splitAsStream(final CharSequence input)
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; }