public static boolean isMacOSX(ExecutionEnvironment execEnv) { try { HostInfo info = HostInfoUtils.getHostInfo(execEnv); return info.getOSFamily() == HostInfo.OSFamily.MACOSX; } catch (IOException ex) { } catch (CancellationException ex) { } return false; }
@Override public void run() { while (true) { if (session.stopped || Thread.interrupted()) { return; } try { if (!HostInfoUtils.fileExists(execEnv, experimentDirectory + "/overview")) { // NOI18N Thread.sleep(200); } else { session.ready = true; return; } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } catch (ConnectException ex) { //Exceptions.printStackTrace(ex); session.error = true; return; } catch (IOException ex) { //Exceptions.printStackTrace(ex); session.error = true; return; } } } };
@Override public Map<String, String> getEnv() { Map<String, String> result = null; if (HostInfoUtils.isHostInfoAvailable(execEnv)) { try { result = HostInfoUtils.getHostInfo(execEnv).getEnvironment(); } catch (IOException ex) { } catch (CancellationException ex) { } } if (result == null) { result = System.getenv(); } return result; }
private synchronized void checkDemanglerIfNeeded() { if (!demanglerChecked) { String exeSuffix = ""; // NOI18N try { HostInfo hostinfo = HostInfoUtils.getHostInfo(env); if (hostinfo.getOSFamily() == HostInfo.OSFamily.WINDOWS) { exeSuffix = ".exe"; // NOI18N } } catch (CancellationException ex) { // TODO:CancellationException error processing } catch (IOException ex) { Exceptions.printStackTrace(ex); } String absPath = HostInfoUtils.searchFile(env, searchPaths, demanglerTool + exeSuffix, true); if (absPath == null) { absPath = HostInfoUtils.searchFile(env, searchPaths, CPPFILT + exeSuffix, true); if (absPath == null) { demanglerTool = null; } else { demanglerTool = absPath; } } else { demanglerTool = absPath; } demanglerChecked = true; } }
osFamily = HostInfoUtils.getHostInfo(env).getOSFamily(); } catch (IOException ex) { } catch (CancellationException ex) { if (!HostInfoUtils.fileExists(env, "/proc")) { // NOI18N return ValidationStatus.invalidStatus(getMessage("ValidationStatus.ProcNotFound")); // NOI18N
@Override public void run() { try { HostInfoUtils.updateHostInfo(execEnv); CompilerSetManagerImpl newCsm = tcm.restoreCompilerSets(csm); if (newCsm != null) { csm = newCsm; newCsmCreated.set(true); } } catch (IOException ex) { ex.printStackTrace(System.err); } catch (InterruptedException ex) { // don't report InterruptedException } finally { SwingUtilities.invokeLater(postWork); } } };
hostInfo = HostInfoUtils.getHostInfo(execEnv); if (HostInfoUtils.fileExists(execEnv, command)) { notFound = false; break;
try { if (pae.getConfiguration().getDevelopmentHost().getExecutionEnvironment().isLocal()) { runDir = HostInfoUtils.getHostInfo(pae.getConfiguration().getDevelopmentHost().getExecutionEnvironment()).getUserDirFile().getAbsolutePath() + runDir.substring(1); } else { runDir = HostInfoUtils.getHostInfo(pae.getConfiguration().getDevelopmentHost().getExecutionEnvironment()).getUserDir() + runDir.substring(1); String testUtility = HostInfoUtils.searchFile(execEnv, Arrays.asList(FILE_LOCATIONS), "test", true); //NOI18N if (testUtility != null) { //otherwise will try to run/debug ExitStatus res = ProcessUtils.execute(execEnv, testUtility, "-x", executable, "-a", "-f", executable); // NOI18N
@Override public void run() { try { HostInfoUtils.updateHostInfo(execEnv); CompilerSetManager newCsm = tcm.restoreCompilerSets(csm); if (newCsm != null) { csm = newCsm; newCsmCreated.set(true); } } catch (IOException ex) { ex.printStackTrace(System.err); } catch (InterruptedException ex) { // don't report InterruptedException } finally { SwingUtilities.invokeLater(postWork); } } };
private String getRemoteDir(ExecutionEnvironment env, File localFile, String dirname) { if (env.isLocal()) { return localFile.getParentFile().getAbsolutePath(); } else { String tmpDir; try { tmpDir = HostInfoUtils.getHostInfo(env).getTempDir(); } catch (Throwable ex) { tmpDir = "/var/tmp"; // NOI18N } return tmpDir + "/tools/" + dirname; // NOI18N } }
public MacroConverter(ExecutionEnvironment env) { envVariables = new HashMap<>(); if (HostInfoUtils.isHostInfoAvailable(env)) { try { HostInfo hostInfo = HostInfoUtils.getHostInfo(env); envVariables.putAll(hostInfo.getEnvironment()); } catch (IOException | CancellationException ex) { // should never == null occur if isHostInfoAvailable(env) => report Exceptions.printStackTrace(ex); } } BrokenReferencesSupport.addTemporaryEnv(env, envVariables); this.expander = (envVariables == null) ? null : MacroExpanderFactory.getExpander(env, false); }
private void getCompilerOutput(String arguments, List<String> options, List<String> undefinedAlternatives, boolean isGcc) { String compilerPath = getPath(); if (compilerPath == null || compilerPath.length() == 0) { return; } ExecutionEnvironment execEnv = getExecutionEnvironment(); if (execEnv.isLocal() && Utilities.isWindows()) { compilerPath = LinkSupport.resolveWindowsLink(compilerPath); } try { if (!HostInfoUtils.fileExists(execEnv, compilerPath)) { compilerPath = getDefaultPath(); if (!HostInfoUtils.fileExists(execEnv, compilerPath)) { return; } } } catch (Throwable ex) { return; } List<String> argsList = new ArrayList<String>(); argsList.addAll(Arrays.asList(arguments.trim().split(" +"))); // NOI18N ProcessUtils.ExitStatus execute = ProcessUtils.execute(execEnv, compilerPath, argsList.toArray(new String[argsList.size()])); if (execute.isOK()) { discoverFlags(execute.output, options, undefinedAlternatives, isGcc); } }
public LDErrorParser(Project project, CompilerFlavor flavor, ExecutionEnvironment execEnv, FileObject relativeTo) { this.execEnv = execEnv; this.project = project; try { HostInfo hostInfo = HostInfoUtils.getHostInfo(execEnv); switch (hostInfo.getOSFamily()) { case MACOSX: isMac = true; checkBuildTrace = true; checkRfs = false; break; case LINUX: case SUNOS: checkBuildTrace = true; checkRfs = execEnv.isRemote(); break; case UNKNOWN: case WINDOWS: // unsuported break; } } catch (IOException ex) { Exceptions.printStackTrace(ex); } catch (CancellationException ex) { // don't report cancellation exception } }
public static String getDefaultDirectory(ExecutionEnvironment env) { String home; if (env.isLocal()) { home = System.getProperty("user.home"); // NOI18N } else if (!(HostInfoUtils.isHostInfoAvailable(env) && ConnectionManager.getInstance().isConnectedTo(env))) { home = null; } else { try { home = HostInfoUtils.getHostInfo(env).getUserDir(); } catch (IOException | ConnectionManager.CancellationException ex) { home = null; } } return home == null ? "" : home; // NOI18N }
if (!HostInfoUtils.fileExists(execEnv, compilerPath)) { compilerPath = getDefaultPath(); if (!HostInfoUtils.fileExists(execEnv, compilerPath)) { return;
HostInfo hostInfo = HostInfoUtils.getHostInfo(ExecutionEnvironmentFactory.getLocal());
public MacroConverter(ExecutionEnvironment env) { envVariables = new HashMap<>(); if (HostInfoUtils.isHostInfoAvailable(env)) { try { HostInfo hostInfo = HostInfoUtils.getHostInfo(env); envVariables.putAll(hostInfo.getEnvironment()); homeDir = hostInfo.getUserDir(); pathName = getPathName(env, hostInfo); pathSeparator = getPathSeparator(hostInfo); } catch (IOException | ConnectionManager.CancellationException ex) { // should never == null occur if isHostInfoAvailable(env) => report Exceptions.printStackTrace(ex); } } this.expander = MacroExpanderFactory.getExpander(env, false); }
if (!HostInfoUtils.fileExists(exEnv, corePath)) { return new ValidationResult(Boolean.FALSE, "ERROR_CORE_DONTEXIST", true); //NOI18N
public ValidationStatus compute(final DLightTarget target) throws InterruptedException { ValidationStatus result = ValidationStatus.initialStatus(); try { if (HostInfoUtils.getHostInfo(target.getExecEnv()).getOSFamily() == OSFamily.SUNOS) { result = ValidationStatus.validStatus(); } else { result = ValidationStatus.invalidStatus(NbBundle.getMessage(ProcFSDataCollectorValidator.class, "SunOSIsSupportedPlatform")); // NOI18N } } catch (IOException ex) { Exceptions.printStackTrace(ex); } catch (CancellationException ex) { Exceptions.printStackTrace(ex); } return result; } }
public static String getDefaultDirectory(ExecutionEnvironment env) { String seed; if (env.isLocal()) { seed = System.getProperty("user.home"); // NOI18N } else if (!(HostInfoUtils.isHostInfoAvailable(env) && ConnectionManager.getInstance().isConnectedTo(env))) { seed = null; } else { try { seed = HostInfoUtils.getHostInfo(env).getUserDir(); } catch (IOException ex) { seed = null; } catch (ConnectionManager.CancellationException ex) { seed = null; } } return seed; } }