SyntaxFix
Write A Post
Hire A Developer
Questions
You can just use the Paths class:
Paths
Path path = Paths.get(textPath);
... assuming you want to use the default file system, of course.