Skip to content

Commit 767e504

Browse files
committed
8347286: (fs) Remove some extensions from java/nio/file/Files/probeContentType/Basic.java
Reviewed-by: rrich Backport-of: d002933c260921d0d582724516d15ebd130b851f
1 parent 735747a commit 767e504

File tree

1 file changed

+2
-13
lines changed
  • test/jdk/java/nio/file/Files/probeContentType

1 file changed

+2
-13
lines changed

test/jdk/java/nio/file/Files/probeContentType/Basic.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.util.stream.Stream;
3939

4040
import jdk.test.lib.Platform;
41-
import jdk.test.lib.OSVersion;
4241
import jdk.internal.util.StaticProperty;
4342

4443
/**
@@ -188,18 +187,8 @@ public static void main(String[] args) throws IOException {
188187
exTypes.add(new ExType("xlsx", List.of("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")));
189188
// 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
190189

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()) {
203192
exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip")));
204193
exTypes.add(new ExType("csv", List.of("text/csv")));
205194
exTypes.add(new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar", "application/x-rar-compressed")));

0 commit comments

Comments
 (0)