boolean (@NotNull String what, @NotNull WebBrowser browser) { if (StringUtil.containsIgnoreCase(browser.getName(), what)) { return true; } String path = browser.getPath(); if (path != null) { String fileName = PathUtil.getFileName(path); if (StringUtil.containsIgnoreCase(fileName, what)) return true; String parentPath = PathUtil.getParentPath(path); String parentPathName = PathUtil.getFileName(parentPath); if ("bin".equals(parentPathName)) { parentPath = PathUtil.getParentPath(parentPath); parentPathName = PathUtil.getFileName(parentPath); } return StringUtil.containsIgnoreCase(parentPathName, what); } return false; }