public static String findCommand(String name) { String path = Path.findCommand(name); if (path == null) { String dir = ToolUtils.getCommandFolder(null); if (dir != null) { path = findCommand(name, dir); // NOI18N } } return path; }
public static String findTools(String toolName) { for (String path : Path.getPath()) { String task = path + File.separatorChar + toolName; File tool = new File(task); if (tool.exists() && tool.isFile()) { return tool.getAbsolutePath(); } else if (Utilities.isWindows()) { task = task + ".exe"; // NOI18N tool = new File(task); if (tool.exists() && tool.isFile()) { return tool.getAbsolutePath(); } } } return toolName; }
String path = Path.getPathAsString() + ":/usr/X11/bin:/usr/X/bin:/usr/X11R6/bin:/opt/gnome/bin" + // NOI18N ":/usr/gnome/bin:/opt/kde/bin:/opt/kde4/bin:/opt/kde3/bin:/usr/kde/bin:/usr/openwin/bin"; // NOI18N
@Override public void run() { File file = new File(txt); boolean ok = false; if (Utilities.isWindows()) { if (txt.endsWith(".lnk")) { // NOI18N ok = false; } else { ok = (file.exists() || new File(txt + ".lnk").exists()) && !file.isDirectory(); // NOI18N } } else { ok = file.exists() && !file.isDirectory(); } if (!ok) { // try users path for (String p : Path.getPath()) { file = new File(p + File.separatorChar + txt); ok = file.exists() && !file.isDirectory(); if (ok) { break; } } } lastValid.put(tool, ok); updateField(field, ok, tool); } });
private String getToolVersion(Tool tool, JTextField tf) { StringBuilder version = new StringBuilder(); version.append(tool.getDisplayName()).append(": "); // NOI18N if (getLastToolValidation(tool.getKind())) { String path = tf.getText(); if (!ToolUtils.isPathAbsolute(path)) { path = Path.findCommand(path); } String v = postVersionInfo(tool, path); if (v != null) { version.append(v); } else { version.append(ToolsPanel.getString("TOOL_VERSION_NOT_FOUND")); // NOI18N } } else { version.append(ToolsPanel.getString("TOOL_NOT_FOUND")); // NOI18N } return version.toString(); }
@Override public void run() { File file = new File(txt); boolean ok = false; if (Utilities.isWindows()) { if (txt.endsWith(".lnk")) { // NOI18N ok = false; } else { ok = (file.exists() || new File(txt + ".lnk").exists()) && !file.isDirectory(); // NOI18N } } else { ok = file.exists() && !file.isDirectory(); } if (!ok) { // try users path for (String p : Path.getPath()) { file = new File(p + File.separatorChar + txt); ok = file.exists() && !file.isDirectory(); if (ok) { break; } } } lastValid.put(tool, ok); updateField(field, ok, tool); } });
private String getToolVersion(Tool tool, JTextField tf) { StringBuilder version = new StringBuilder(); version.append(tool.getDisplayName()).append(": "); // NOI18N if (getLastToolValidation(tool.getKind())) { String path = tf.getText(); if (!CndPathUtilities.isAbsolute(path)){ path = Path.findCommand(path); } String v = postVersionInfo(tool, path); if (v != null) { version.append(v); } else { version.append(ToolsPanel.getString("TOOL_VERSION_NOT_FOUND")); // NOI18N } } else { version.append(ToolsPanel.getString("TOOL_NOT_FOUND")); // NOI18N } return version.toString(); }
for (String dir : Path.getPath()) { dir = dir.toLowerCase().replace("\\", "/"); // NOI18N if (dir.contains("cygwin")) { // NOI18N
/*package*/ static NativeExitStatus execute(ExecutionEnvironment ev, String executable, String[] env, String... args) throws IOException { if (ev.isLocal()) { String exePath = Path.findCommand(executable); if (exePath == null) { throw new IOException(getString("NOT_FOUND", executable)); // NOI18N
for (String dir : Path.getPath()) { dir = dir.toLowerCase().replace("\\", "/"); // NOI18N if (dir.contains("cygwin")) { // NOI18N
if ((!exists(makeTool.getPath(), pi) && Path.findCommand(makeTool.getPath()) == null) || ToolsPanelSupport.isUnsupportedMake(file.getPath())) { runBTA = true;
/** * Get the command folder (toolchain definition, which users the Windows registry) or the user's path */ public static String getCommandFolder(ToolchainDescriptor descriptor) { if (!Utilities.isWindows()) { return null; } String res = getCommandDir(descriptor); if (res != null) { return res; } ToolchainManagerImpl tcm = ToolchainManagerImpl.getImpl(); for(ToolchainDescriptor td : tcm.getToolchains(PlatformTypes.PLATFORM_WINDOWS)){ if (td != null) { res = getCommandDir(td); if (res != null) { return res; } } } for (String dir : Path.getPath()) { dir = dir.toLowerCase().replace("\\", "/"); // NOI18N if (dir.contains("/msys/1.0") && dir.contains("/bin")) { // NOI18N return dir; } } return null; }
/** * Get the command folder (toolchain definition, which users the Windows registry) or the user's path */ public static String getCommandFolder(ToolchainDescriptor descriptor) { if (!Utilities.isWindows()) { return null; } String res = getCommandDir(descriptor); if (res != null) { return res; } ToolchainManagerImpl tcm = ToolchainManagerImpl.getImpl(); for(ToolchainDescriptor td : tcm.getToolchains(PlatformTypes.PLATFORM_WINDOWS)){ if (td != null) { res = getCommandDir(td); if (res != null) { return res; } } } for (String dir : Path.getPath()) { dir = dir.toLowerCase().replace("\\", "/"); // NOI18N if (dir.contains("/msys/1.0") && dir.contains("/bin")) { // NOI18N return dir; } } return null; }
initCompilerSets(Path.getPath()); } else { final AtomicReference<Thread> threadRef = new AtomicReference<Thread>();
if (pattern != null && pattern.length() > 0) { Pattern p = Pattern.compile(pattern); for (String dir : Path.getPath()) { if (p.matcher(dir).find()) { return dir;