String (@NotNull String rootPath) { final File rootFile = new File(rootPath); if (rootFile.isFile()) { return rootFile.getAbsolutePath(); } for (String dir : DIRS_WITH_BINARY) { final File subDir; if (StringUtil.isEmpty(dir)) { subDir = rootFile; } else { subDir = new File(rootFile, dir); } if (!subDir.isDirectory()) { continue; } for (String binaryName : getBinaryNames()) { final File executable = new File(subDir, binaryName); if (executable.isFile()) { return executable.getAbsolutePath(); } } } return null; }