| package org.eclipse.epp.installer.launcher; |
| |
| /** |
| * <p> |
| * Copyright (c) 2006, Instantiations, Inc.<br> |
| * All Rights Reserved |
| */ |
| public class Platform { |
| |
| private static final String PROP_OS = "os.name"; |
| private static final String PROP_ARCH = "os.arch"; |
| |
| public static final String ARCH_PPC = "ppc"; |
| public static final String ARCH_X86 = "x86"; |
| public static final String ARCH_X86_64 = "x86_64"; |
| |
| public static final String OS_WIN32 = "win32"; |
| public static final String OS_LINUX = "linux"; |
| public static final String OS_MACOSX = "macosx"; |
| public static final String OS_UNKNOWN = "unknown"; |
| |
| public static String getOS() { |
| String name = System.getProperty(PROP_OS); |
| if(name.startsWith("Windows")) { |
| return OS_WIN32; |
| } |
| else if( name.startsWith("Linux")) { |
| return OS_LINUX; |
| } |
| return OS_UNKNOWN; |
| } |
| |
| public static String getArch() { |
| String arch = System.getProperty(PROP_ARCH); |
| if( arch.equals("amd64")) { |
| return ARCH_X86_64; |
| } |
| else if( arch.equals("i386") || arch.equals("i486") || arch.equals("i586") || arch.equals("i686") ) { |
| return ARCH_X86; |
| } |
| return arch; |
| } |
| } |