@@ -0,0 +1,2534 @@
+/*%0A * The MIT License (MIT)%0A * %0A * Copyright (c) 2013-2015 Jeff Nelson, Cinchapi Software Collective%0A * %0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A * %0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A * %0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A * THE SOFTWARE.%0A */%0Apackage org.cinchapi.concourse.util;%0A%0A/**%0A * A utility class that assists with extracting information about the underlying%0A * platform (i.e. the operating system, architecture, etc)%0A * %0A * @author jnelson%0A */%0Apublic final class Platform %7B%0A%09%0A%09/**%0A%09 * The name of the operating system on which the current JVM is running.%0A%09 */%0A%09public static String OPERATING_SYSTEM = System.getProperty(%22os.name%22);%0A%09%0A%09/**%0A%09 * Return %7B@code true%7D if current platform is Windows based.%0A%09 * @return %7B@code true%7D if this is Windows%0A%09 */%0A%09public static boolean isWindows()%7B%0A%09%09return OPERATING_SYSTEM.toLowerCase().contains(%22windows%22);%0A%09%7D%0A%09%0A%09/**%0A%09 * Return %7B@code true%7D if current platform is OS X based.%0A%09 * @return %7B@code true%7D if this is OS X%0A%09 */%0A%09public static boolean isMacOsX()%7B%0A%09%09return OPERATING_SYSTEM.toLowerCase().contains(%22os x%22);%0A%09%7D%0A%09%0A%09/**%0A%09 * Return %7B@code true%7D if current platform is Linux based.%0A%09 * @return %7B@code true%7D if this is Linux%0A%09 */%0A%09public static boolean isLinux()%7B%0A%09%09String os = OPERATING_SYSTEM.toLowerCase();%0A%09%09return os.contains(%22nix%22) %7C%7C os.contains(%22nux%22) %7C%7C os.contains(%22aix%22);%0A%09%7D%0A%09%0A%09/**%0A%09 * Return %7B@code true%7D if current platform is Solaris based.%0A%09 * @return %7B@code true%7D if this is Solaris%0A%09 */%0A%09public static boolean isSolaris()%7B%0A%09%09return OPERATING_SYSTEM.toLowerCase().contains(%22solaris%22);%0A%09%7D%0A%09%0A%09private Platform() %7B/* noop */%0A%09%7D%0A%0A%7D%0A

add util class to get information about the underlying platform