|
38 | 38 | import java.util.stream.Stream; |
39 | 39 |
|
40 | 40 | import jdk.test.lib.Platform; |
41 | | -import jdk.test.lib.OSVersion; |
42 | 41 | import jdk.internal.util.StaticProperty; |
43 | 42 |
|
44 | 43 | /** |
@@ -188,18 +187,8 @@ public static void main(String[] args) throws IOException { |
188 | 187 | exTypes.add(new ExType("xlsx", List.of("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))); |
189 | 188 | // exTypes.add(new ExType("wasm", List.of("application/wasm"))); Note. "wasm" is added via JDK-8297609 (Java 20) which not exist in current java version yet |
190 | 189 |
|
191 | | - // extensions with content type that differs on Windows 11+ and |
192 | | - // Windows Server 2025 |
193 | | - if (Platform.isWindows() && |
194 | | - (System.getProperty("os.name").matches("^.*[11|2025]$") || |
195 | | - new OSVersion(10, 0).compareTo(OSVersion.current()) > 0)) { |
196 | | - System.out.println("Windows 11+ detected: using different types"); |
197 | | - exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip", "application/x-compressed"))); |
198 | | - exTypes.add(new ExType("csv", List.of("text/csv", "application/vnd.ms-excel"))); |
199 | | - exTypes.add(new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar", "application/x-rar-compressed", "application/x-compressed"))); |
200 | | - exTypes.add(new ExType("rtf", List.of("application/rtf", "text/rtf", "application/msword"))); |
201 | | - exTypes.add(new ExType("7z", List.of("application/x-7z-compressed", "application/x-compressed"))); |
202 | | - } else { |
| 190 | + // extensions with consistent content type on Unix (but not on Windows) |
| 191 | + if (!Platform.isWindows()) { |
203 | 192 | exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip"))); |
204 | 193 | exTypes.add(new ExType("csv", List.of("text/csv"))); |
205 | 194 | exTypes.add(new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar", "application/x-rar-compressed"))); |
|
0 commit comments