How can I create a java.nio.file.Path
object from a String
object in Java 7?
I.e.
String textPath = "c:/dir1/dir2/dir3";
Path path = ?;
where ?
is the missing code that uses textPath
.
You can just use the Paths
class:
Path path = Paths.get(textPath);
... assuming you want to use the default file system, of course.