package com.yi21.files;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Yi21FilesProbeContentType {
public static void main(String[] args) {
try {
Path path = Paths.get("com\\yi21\\files\\Yi21FilesProbeContentType.java");
String type = Files.probeContentType(path);
System.out.println(path + " 的类型为: " + type);
} catch (IOException e) {
System.out.println("出错: " + e.getMessage());
}
}
}
03-26
1069
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-22
3297
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-12
1369
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-14
984
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-15
5760
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-06
8295
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-26