]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/src/org/simantics/district/maps/server/utils/EnvUtil.java
Adding pkg-precompiled tileserver-mapnik to avoid npm install
[simantics/district.git] / org.simantics.maps.server / src / org / simantics / district / maps / server / utils / EnvUtil.java
1 package org.simantics.district.maps.server.utils;
2
3 public class EnvUtil {
4
5     public static String calculateArch() {
6         String osArch = System.getProperty("os.arch", "");
7         osArch = osArch.toLowerCase();
8         if (osArch.equals("i386") || osArch.equals("i586") || osArch.equals("i686") || osArch.equals("x86"))
9             return "x86";
10         if (osArch.startsWith("amd64") || osArch.startsWith("x86_64"))
11             return "x64";
12         throw new UnsupportedOperationException("Architecture " + osArch + " is not supported!");
13     }
14
15     public static String calculateOS() {
16         String osName = System.getProperty("os.name", "");
17         osName = osName.toLowerCase();
18         if (osName.startsWith("windows"))
19             return "win";
20         throw new UnsupportedOperationException("Operating system " + osName + " is not supported!");
21     }
22 }