From da34bf0d3f8b3a3ac4bb73703ef67502a59a92d1 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 7 Oct 2019 01:07:58 +0200 Subject: [PATCH] Improve Windows system detection Use apache commons instead of terrifyingly fragile black magic. --- airsonic-main/src/main/java/org/airsonic/player/util/Util.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airsonic-main/src/main/java/org/airsonic/player/util/Util.java b/airsonic-main/src/main/java/org/airsonic/player/util/Util.java index 8cbd8cdb..3d5e4aa8 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/util/Util.java +++ b/airsonic-main/src/main/java/org/airsonic/player/util/Util.java @@ -21,6 +21,7 @@ package org.airsonic.player.util; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.lang3.SystemUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.MultiValueMap; @@ -66,7 +67,7 @@ public final class Util { } public static boolean isWindows() { - return System.getProperty("os.name", "Windows").toLowerCase().startsWith("windows"); + return SystemUtils.IS_OS_WINDOWS; } /**