Example usage for org.apache.commons.lang SystemUtils IS_OS_SOLARIS

List of usage examples for org.apache.commons.lang SystemUtils IS_OS_SOLARIS

Introduction

In this page you can find the example usage for org.apache.commons.lang SystemUtils IS_OS_SOLARIS.

Prototype

boolean IS_OS_SOLARIS

To view the source code for org.apache.commons.lang SystemUtils IS_OS_SOLARIS.

Click Source Link

Document

Is true if this is Solaris.

The field will return false if OS_NAME is null.

Usage

From source file:ddf.content.plugin.video.VideoThumbnailPlugin.java

private String getBundledFFmpegBinaryPath() {
    if (SystemUtils.IS_OS_LINUX) {
        return "linux/ffmpeg";
    } else if (SystemUtils.IS_OS_MAC) {
        return "osx/ffmpeg";
    } else if (SystemUtils.IS_OS_SOLARIS) {
        return "solaris/ffmpeg";
    } else if (SystemUtils.IS_OS_WINDOWS) {
        return "windows/ffmpeg.exe";
    } else {//from  ww  w. java  2  s .  co m
        throw new RuntimeException("OS is not Linux, Mac, Solaris, or Windows."
                + " No FFmpeg binary is available for this OS, so the plugin will not work.");
    }
}

From source file:ddf.content.plugin.video.TestVideoThumbnailPlugin.java

private void setUpMockBundleContext() {
    mockBundleContext = mock(BundleContext.class);

    final Bundle mockBundle = mock(Bundle.class);
    doReturn(mockBundle).when(mockBundleContext).getBundle();

    String ffmpegResourcePath;/*from w  ww.ja v  a  2s . c  o m*/
    URL ffmpegBinaryUrl;

    if (SystemUtils.IS_OS_LINUX) {
        ffmpegResourcePath = "linux/ffmpeg";
    } else if (SystemUtils.IS_OS_MAC) {
        ffmpegResourcePath = "osx/ffmpeg";
    } else if (SystemUtils.IS_OS_WINDOWS) {
        ffmpegResourcePath = "windows/ffmpeg.exe";
    } else if (SystemUtils.IS_OS_SOLARIS) {
        ffmpegResourcePath = "solaris/ffmpeg";
    } else {
        fail("Platform is not Linux, Mac, or Windows. No FFmpeg binaries are provided for this platform.");
        return;
    }

    ffmpegBinaryUrl = getClass().getClassLoader().getResource(ffmpegResourcePath);

    doReturn(ffmpegBinaryUrl).when(mockBundle).getEntry(ffmpegResourcePath);
}

From source file:org.cleartk.util.PlatformDetection.java

public PlatformDetection() {
    // resolve OS
    if (SystemUtils.IS_OS_WINDOWS) {
        this.os = OS_WINDOWS;
    } else if (SystemUtils.IS_OS_MAC_OSX) {
        this.os = OS_OSX;
    } else if (SystemUtils.IS_OS_SOLARIS) {
        this.os = OS_SOLARIS;
    } else if (SystemUtils.IS_OS_LINUX) {
        this.os = OS_LINUX;
    } else {/*from  w w w.  ja v a 2s .c  o  m*/
        throw new IllegalArgumentException("Unknown operating system " + SystemUtils.OS_NAME);
    }

    // resolve architecture
    Map<String, String> archMap = new HashMap<String, String>();
    archMap.put("x86", ARCH_X86_32);
    archMap.put("i386", ARCH_X86_32);
    archMap.put("i486", ARCH_X86_32);
    archMap.put("i586", ARCH_X86_32);
    archMap.put("i686", ARCH_X86_32);
    archMap.put("x86_64", ARCH_X86_64);
    archMap.put("amd64", ARCH_X86_64);
    archMap.put("powerpc", ARCH_PPC);
    this.arch = archMap.get(SystemUtils.OS_ARCH);
    if (this.arch == null) {
        throw new IllegalArgumentException("Unknown architecture " + SystemUtils.OS_ARCH);
    }
}

From source file:org.openoffice.maven.ConfigurationManager.java

/**
 * Returns the path to the SDK binaries depending on the OS and the
 * architecture.//w  w  w  .  jav a  2 s  .c  o  m
 * 
 * @param pHome
 *            the OpenOffice.org SDK home
 * @return the full path to the SDK binaries
 */
private static String getSdkBinPath() {
    File sdkHome = Environment.getOoSdkHome();
    // OOo SDK does not seem to include the target os in their packaging
    // anymore. Tested with 3.2.0
    String path = "/bin";
    if (new File(sdkHome, path).exists()) {
        return new File(sdkHome, path).getPath();
    }

    // Get the Architecture properties
    String arch = System.getProperty("os.arch").toLowerCase();

    if (SystemUtils.IS_OS_WINDOWS) {
        path = "/windows/bin/";
    } else if (SystemUtils.IS_OS_SOLARIS) {
        if (arch.equals("sparc")) {
            path = "/solsparc/bin";
        } else {
            path = "/solintel/bin";
        }
    } else if (SystemUtils.IS_OS_MAC) {
        path = "/bin";
    } else {
        path = "/linux/bin";
    }

    return new File(sdkHome, path).getPath();
}

From source file:util.PosixComplianceUtil.java

private boolean isFullyPosixCompliant() {
    return SystemUtils.IS_OS_AIX || SystemUtils.IS_OS_HP_UX || SystemUtils.IS_OS_IRIX
            || SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_SOLARIS;
}