X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.excel%2Fsrc%2Forg%2Fsimantics%2Fexcel%2FExecEnvironment.java;h=b2347ef7f586d54660830f6d4e7bfb955cf0d06a;hb=refs%2Fchanges%2F38%2F238%2F2;hp=b144bc377afe796d5a3f648cff42fa6c1210506e;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.excel/src/org/simantics/excel/ExecEnvironment.java b/bundles/org.simantics.excel/src/org/simantics/excel/ExecEnvironment.java index b144bc377..b2347ef7f 100644 --- a/bundles/org.simantics.excel/src/org/simantics/excel/ExecEnvironment.java +++ b/bundles/org.simantics.excel/src/org/simantics/excel/ExecEnvironment.java @@ -1,54 +1,54 @@ -package org.simantics.excel; - -public class ExecEnvironment { - - public enum OSType { - APPLE, LINUX, SUN, WINDOWS, UNKNOWN - } - - public enum ARCHType { - PPC, PPC_64, SPARC, X86, X86_64, UNKNOWN; - } - - public final OSType os; - public final ARCHType arch; - - private ExecEnvironment(OSType os, ARCHType arch) { - this.os = os; - this.arch = arch; - } - - public static ExecEnvironment calculate() { - return new ExecEnvironment(calculateOS(), calculateArch()); - } - - public static ARCHType calculateArch() { - String osArch = System.getProperty("os.arch", ""); - osArch = osArch.toLowerCase(); - if (osArch.equals("i386") || osArch.equals("i586") || osArch.equals("i686") || osArch.equals("x86")) - return ARCHType.X86; - if (osArch.startsWith("amd64") || osArch.startsWith("x86_64")) - return ARCHType.X86_64; - if (osArch.equals("ppc")) - return ARCHType.PPC; - if (osArch.startsWith("ppc")) - return ARCHType.PPC_64; - if (osArch.startsWith("sparc")) - return ARCHType.SPARC; - return ARCHType.UNKNOWN; - } - - public static OSType calculateOS() { - String osName = System.getProperty("os.name", ""); - osName = osName.toLowerCase(); - if (osName.startsWith("mac os x")) - return OSType.APPLE; - if (osName.startsWith("windows")) - return OSType.WINDOWS; - if (osName.startsWith("linux")) - return OSType.LINUX; - if (osName.startsWith("sun")) - return OSType.SUN; - return OSType.UNKNOWN; - } -} +package org.simantics.excel; + +public class ExecEnvironment { + + public enum OSType { + APPLE, LINUX, SUN, WINDOWS, UNKNOWN + } + + public enum ARCHType { + PPC, PPC_64, SPARC, X86, X86_64, UNKNOWN; + } + + public final OSType os; + public final ARCHType arch; + + private ExecEnvironment(OSType os, ARCHType arch) { + this.os = os; + this.arch = arch; + } + + public static ExecEnvironment calculate() { + return new ExecEnvironment(calculateOS(), calculateArch()); + } + + public static ARCHType calculateArch() { + String osArch = System.getProperty("os.arch", ""); + osArch = osArch.toLowerCase(); + if (osArch.equals("i386") || osArch.equals("i586") || osArch.equals("i686") || osArch.equals("x86")) + return ARCHType.X86; + if (osArch.startsWith("amd64") || osArch.startsWith("x86_64")) + return ARCHType.X86_64; + if (osArch.equals("ppc")) + return ARCHType.PPC; + if (osArch.startsWith("ppc")) + return ARCHType.PPC_64; + if (osArch.startsWith("sparc")) + return ARCHType.SPARC; + return ARCHType.UNKNOWN; + } + + public static OSType calculateOS() { + String osName = System.getProperty("os.name", ""); + osName = osName.toLowerCase(); + if (osName.startsWith("mac os x")) + return OSType.APPLE; + if (osName.startsWith("windows")) + return OSType.WINDOWS; + if (osName.startsWith("linux")) + return OSType.LINUX; + if (osName.startsWith("sun")) + return OSType.SUN; + return OSType.UNKNOWN; + } +}