/** * Returns the platform given the operating system name, architecture and version. * * @param name the operating system name or symbolic name * @param arch the operating system architecture, or symbolic architecture * @param version the operating system version. May be {@code null} * @return the corresponding platform */ public Platform getPlatform(String name, String arch, String version) { return getPlatform(name, arch, version, null); }
/** * Returns the platform for the specified operating system name and architecture. * * @param name the operating system name or symbolic name * @param arch the operating system architecture, or symbolic architecture * @return the corresponding platform */ public Platform getPlatform(String name, String arch) { return getPlatform(name, arch, null); }
/** * Returns the platform given the operating system name, architecture and version. * * @param name the operating system name or symbolic name * @param arch the operating system architecture, or symbolic architecture * @param version the operating system version. May be {@code null} * @param javaVersion the java version * @return the corresponding platform */ public Platform getPlatform(String name, String arch, String version, String javaVersion) { Platform result; Name pname = getName(name); Arch parch = getArch(arch); Platform match = findMatch(name, pname, parch, version); result = getPlatform(match, parch, version, javaVersion); return result; }
/** * Returns the current platform given the operating system name, architecture and version. * <p/> * This may query the underlying OS to determine the platform name. * * @param name the operating system name * @param arch the operating system architecture, or symbolic architecture * @param version the operating system version. May be {@code null} * @param javaVersion the java version. May be {@code null} * @return the corresponding platform */ public Platform getCurrentPlatform(String name, String arch, String version, String javaVersion) { Platform result; Name pname = getCurrentOSName(name); Arch parch = getArch(arch); Platform match = findMatch(name, pname, parch, version); result = getPlatform(match, parch, version, javaVersion); return result; }
Platform platform = platforms.getPlatform(name, arch); if (platform.getName() == Platform.Name.UNKNOWN)