Java examples for File Path IO:Path
Create path from URI
import java.net.URI; import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static void main(String[] args) { Path path = null;/*from w w w. j a v a 2 s . c o m*/ try { path = Paths.get(new URI("file:///C:/home/docs/users.txt")); } catch (URISyntaxException e) { System.out.println("Bad URI"); } } }