protected static boolean isWindows() { return Platform.OS_WIN32.equals(Platform.getOS()); }
private ConfigurationDescriptor getConfigdataFromProductFile(File installFolder) { Object[] productFileInfo = loadEclipseProductFile(installFolder); //Contrarily to the runtime, when the .eclipseproduct can't be found, we don't fallback to org.eclipse.platform. if (productFileInfo.length == 0) return null; return new ConfigurationDescriptor((String) productFileInfo[0], (Identifier) productFileInfo[1], getInstallDirHash(installFolder), Platform.getOS() + '_' + Platform.getWS() + '_' + Platform.getOSArch(), null); }
private boolean filterByOS(String os) { return !os.equals(Platform.getOS()); }
public boolean isAvailable() { return Constants.WS_WIN32.equalsIgnoreCase(Platform.getOS()); } /*
public String getDisplayOS() { if (fOS == null || fOS.trim().length() == 0) return Platform.getOS(); return fOS.trim(); }
public static File toFile(URI uri) { if (Platform.OS_WIN32.equals(Platform.getOS())) { return URIUtil.toFile(uri); } return new File(uri); }
@Override public File detectInstallLocation() { // We want a Mac OSX VM install so don't process the install location for this type if(Platform.OS_MACOSX.equals(Platform.getOS())) { return null; } return getJavaHomeLocation(); }
/** * Returns the target operating system as specified on the <b>Environment</b> * tab of the <b>Plug-in Development > Target Platform</b> preference page. * * @return the target operating system */ public static String getOS() { return getProperty(ICoreConstants.OS, Platform.getOS()); }
@Override public File detectInstallLocation() { // We want a Mac OSX VM install so don't process the install location for this type if(Platform.OS_MACOSX.equals(Platform.getOS())) { return null; } return getJavaHomeLocation(); }
private static String[] quoteWindowsArgs(String[] cmdLine) { // see https://bugs.eclipse.org/387504 , workaround for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511002 if (Platform.getOS().equals(Constants.OS_WIN32)) { String[] winCmdLine = new String[cmdLine.length]; if(cmdLine.length > 0) { winCmdLine[0] = cmdLine[0]; } for (int i = 1; i < cmdLine.length; i++) { winCmdLine[i] = winQuote(cmdLine[i]); } cmdLine = winCmdLine; } return cmdLine; }
public static boolean isPlatformCaseSensitive() { return Platform.OS_MACOSX.equals(Platform.getOS()) ? false : new java.io.File("a").compareTo(new java.io.File("A")) != 0; //$NON-NLS-1$//$NON-NLS-2$ }
/** * Fix uris by adding missing // to single file:/ prefix */ public static String fixURI(URI uri) { if (Platform.OS_WIN32.equals(Platform.getOS()) && URIUtil.isFileURI(uri)) { uri = URIUtil.toFile(uri).toURI(); } String uriString = uri.toString(); return uriString.replaceFirst("file:/([^/])", "file:///$1"); }
static String defaultFilename() { if (!Platform.getOS().equals(Platform.OS_LINUX)) return internalFilename(); String HOME = System.getProperty("user.home"); //$NON-NLS-1$ if (HOME==null) return internalFilename(); return HOME+"/.ssh/known_hosts"; //$NON-NLS-1$ }
static private IPath convertToProperCase(IPath path) { if (Platform.getOS().equals(Platform.OS_WIN32)) return Path.fromPortableString(path.toPortableString().toLowerCase()); return path; }
static private IPath convertToProperCase(IPath path) { if (Platform.getOS().equals(Platform.OS_WIN32)) return Path.fromPortableString(path.toPortableString().toLowerCase()); return path; }
static private IPath convertToProperCase(IPath path) { if (Platform.getOS().equals(Platform.OS_WIN32)) return Path.fromPortableString(path.toPortableString().toLowerCase()); return path; }
private IPath convertToProperCase(IPath path) { if (Platform.getOS().equals(Platform.OS_WIN32)) return Path.fromPortableString(path.toPortableString() .toLowerCase()); return path; }
private IPath fixDevice(IPath path) { if (path != null && path.getDevice() != null) { return path.setDevice(path.getDevice().toUpperCase()); } if (Platform.OS_WIN32.equals(Platform.getOS()) && path != null && path.toString().startsWith("//")) { String server = path.segment(0); String pathStr = path.toString().replace(server, server.toUpperCase()); return new Path(pathStr); } return path; }
/** * On Windows, interrupt the spawned program by send it a CTRL-C (even if it's a Cygwin program). On * linux, interrupt it by raising a SIGINT. * * @since 5.2 */ public int interruptCTRLC() { if (Platform.getOS().equals(Platform.OS_WIN32)) { return raise(pid, CTRLC); } else { return interrupt(); } }
public PersistentPTY(Mode mode) throws IOException { super(mode); in2 = new PersistentPTYInputStream(new MasterFD()); out2 = new PersistentPTYOutputStream(new MasterFD(), !Platform.OS_WIN32.equals(Platform.getOS())); }