1ef39d40dSAndrew Rist /************************************************************** 2*a3a36028Smseidel * 3ef39d40dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4ef39d40dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5ef39d40dSAndrew Rist * distributed with this work for additional information 6ef39d40dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7ef39d40dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8ef39d40dSAndrew Rist * "License"); you may not use this file except in compliance 9ef39d40dSAndrew Rist * with the License. You may obtain a copy of the License at 10*a3a36028Smseidel * 11ef39d40dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*a3a36028Smseidel * 13ef39d40dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14ef39d40dSAndrew Rist * software distributed under the License is distributed on an 15ef39d40dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16ef39d40dSAndrew Rist * KIND, either express or implied. See the License for the 17ef39d40dSAndrew Rist * specific language governing permissions and limitations 18ef39d40dSAndrew Rist * under the License. 19*a3a36028Smseidel * 20ef39d40dSAndrew Rist *************************************************************/ 21ef39d40dSAndrew Rist 22ef39d40dSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir package helper; 25cdf0e10cSrcweir 26cdf0e10cSrcweir /** 27*a3a36028Smseidel * Helper object, to identify the current Operating System. 28cdf0e10cSrcweir * @author ll93751 29cdf0e10cSrcweir */ 30cdf0e10cSrcweir public class OSHelper 31cdf0e10cSrcweir { isWindows()32*a3a36028Smseidel public static boolean isWindows() 33*a3a36028Smseidel { 34*a3a36028Smseidel String sOSName = System.getProperty("os.name"); 35*a3a36028Smseidel if (sOSName.toLowerCase().startsWith("windows")) 36*a3a36028Smseidel { 37*a3a36028Smseidel return true; 38*a3a36028Smseidel } 39*a3a36028Smseidel return false; 40*a3a36028Smseidel } 41*a3a36028Smseidel // not need 42*a3a36028Smseidel // public static boolean isUnix() isSolarisIntel()43*a3a36028Smseidel public static boolean isSolarisIntel() 44*a3a36028Smseidel { 45*a3a36028Smseidel if ( ( System.getProperty("os.name").toLowerCase().startsWith("solaris") || 46*a3a36028Smseidel System.getProperty("os.name").toLowerCase().startsWith("sunos") ) && 47*a3a36028Smseidel System.getProperty("os.arch").equals("x86")) 48*a3a36028Smseidel { 49*a3a36028Smseidel return true; 50*a3a36028Smseidel } 51*a3a36028Smseidel return false; 52*a3a36028Smseidel } isSolarisSparc()53*a3a36028Smseidel public static boolean isSolarisSparc() 54*a3a36028Smseidel { 55*a3a36028Smseidel if ( ( System.getProperty("os.name").toLowerCase().startsWith("solaris") || 56*a3a36028Smseidel System.getProperty("os.name").toLowerCase().startsWith("sunos") ) && 57*a3a36028Smseidel System.getProperty("os.arch").equals("sparc")) 58*a3a36028Smseidel { 59*a3a36028Smseidel return true; 60*a3a36028Smseidel } 61*a3a36028Smseidel return false; 62*a3a36028Smseidel } isLinuxIntel()63*a3a36028Smseidel public static boolean isLinuxIntel() 64*a3a36028Smseidel { 65*a3a36028Smseidel if (System.getProperty("os.name").toLowerCase().startsWith("linux") && 66*a3a36028Smseidel System.getProperty("os.arch").equals("i386")) 67*a3a36028Smseidel { 68*a3a36028Smseidel return true; 69*a3a36028Smseidel } 70*a3a36028Smseidel return false; 71*a3a36028Smseidel } 72*a3a36028Smseidel isUnix()73*a3a36028Smseidel public static boolean isUnix() 74*a3a36028Smseidel { 75*a3a36028Smseidel if (isLinuxIntel() || 76*a3a36028Smseidel isSolarisIntel() || 77*a3a36028Smseidel isSolarisSparc()) 78*a3a36028Smseidel { 79*a3a36028Smseidel return true; 80*a3a36028Smseidel } 81*a3a36028Smseidel return false; 82*a3a36028Smseidel } 83cdf0e10cSrcweir 84cdf0e10cSrcweir } 85