java.io.File和java.nio.file.Files之间的互操作性
import java.io.File; import java.net.URI; /** 时代Java公众号 - nowjava.com 提供 **/ import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static void main(String[] args) { try { Path path = Paths.get(new URI("file:///C:/home/docs/users.txt")); File file = new File("C:\\home\\docs\\users.txt");//来自 nowjava.com - 时 代 Java Path toPath = file.toPath(); System.out.println(