从URI创建路径
import java.net.URI; import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths;/** nowjava - 时代Java 提 供 **/ public class Main { public static void main(String[] args) { Path path = null; try { path = Paths.get(new URI("file:///C:/home/docs/users.txt")); } catch (URISyntaxException e) { System.out.println("Bad URI"); } //N o w J a v a . c o m - 时代Java 提供 } }