Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 491 Bytes

File metadata and controls

32 lines (27 loc) · 491 Bytes

os-detector

Lightweight fork of SystemUtils.java from Apache Commons Lang

Maven

<dependency>
    <groupId>com.harium.util</groupId>
    <artifactId>os-detector</artifactId>
    <version>1.0.0</version>
</dependency>

Usage

Use it as Apache Commons Lang:

if (SystemUtils.IS_OS_WINDOWS) {
    // do something
} else {
    // do something
}

Or with OSDetector:

if (OS.Linux == OSDetector.getOS()) {
    // do something
} else {
    // do something
}