File tree 3 files changed +8
-7
lines changed
src/java.base/unix/classes/sun/nio/fs
test/jdk/java/nio/file/spi
3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2008, 2012 , 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
25
25
26
26
package sun .nio .fs ;
27
27
28
- import java .nio .file .FileSystems ;
29
28
import java .nio .file .spi .FileTypeDetector ;
30
- import java .nio .file .spi .FileSystemProvider ;
31
29
32
30
public class DefaultFileTypeDetector {
33
31
private DefaultFileTypeDetector () { }
34
32
35
33
public static FileTypeDetector create () {
36
- FileSystemProvider provider = FileSystems .getDefault ().provider ();
37
- return ((UnixFileSystemProvider )provider ).getFileTypeDetector ();
34
+ return DefaultFileSystemProvider .instance ().getFileTypeDetector ();
38
35
}
39
36
}
Original file line number Diff line number Diff line change 23
23
24
24
/*
25
25
* @test
26
- * @bug 4313887 7006126 8142968 8178380 8183320 8210112 8266345 8263940 8331467 8346573
26
+ * @bug 4313887 7006126 8142968 8178380 8183320 8210112 8266345 8263940 8331467
27
+ * 8346573 8346722
27
28
* @modules jdk.jartool jdk.jlink
28
29
* @library /test/lib
29
30
* @build testfsp/* testapp/* CustomSystemClassLoader
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2017, 2024 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2017, 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
@@ -58,5 +58,8 @@ public static void main(String[] args) throws Exception {
58
58
throw new RuntimeException ("'path' not in default file system" );
59
59
if (!path .equals (foo ))
60
60
throw new RuntimeException (path + " not equal to " + foo );
61
+
62
+ // exercise the file type detector
63
+ String fileType = Files .probeContentType (Path .of ("." ));
61
64
}
62
65
}
You can’t perform that action at this time.
0 commit comments