|
1 | 1 | /* |
2 | | - * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
40 | 40 |
|
41 | 41 | import jdk.internal.util.OperatingSystem; |
42 | 42 | import jdk.internal.util.OSVersion; |
| 43 | +import jdk.internal.util.StaticProperty; |
43 | 44 |
|
44 | 45 | /** |
45 | 46 | * Uses Files.probeContentType to probe html file, custom file type, and minimal |
@@ -83,7 +84,7 @@ private static int checkContentTypes(String expected, String actual) { |
83 | 84 | if (!expected.equals(actual)) { |
84 | 85 | if (!OperatingSystem.isWindows()) { |
85 | 86 | Path userMimeTypes = |
86 | | - Path.of(System.getProperty("user.home"), ".mime.types"); |
| 87 | + Path.of(StaticProperty.userHome(), ".mime.types"); |
87 | 88 | checkMimeTypesFile(userMimeTypes); |
88 | 89 |
|
89 | 90 | Path etcMimeTypes = Path.of("/etc/mime.types"); |
@@ -188,9 +189,10 @@ public static void main(String[] args) throws IOException { |
188 | 189 | exTypes.add(new ExType("xlsx", List.of("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))); |
189 | 190 | exTypes.add(new ExType("wasm", List.of("application/wasm"))); |
190 | 191 |
|
191 | | - // extensions with content type that differs on Windows 11+ |
| 192 | + // extensions with content type that differs on Windows 11+ and |
| 193 | + // Windows Server 2025 |
192 | 194 | if (OperatingSystem.isWindows() && |
193 | | - (System.getProperty("os.name").endsWith("11") || |
| 195 | + (StaticProperty.osName().matches("^.*[11|2025]$") || |
194 | 196 | new OSVersion(10, 0).compareTo(OSVersion.current()) > 0)) { |
195 | 197 | System.out.println("Windows 11+ detected: using different types"); |
196 | 198 | exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip", "application/x-compressed"))); |
|
0 commit comments