How to access a sub-file/folder in Java 7 java.nio.file.Path?

Use the resolve method on Path.

There are two methods with this name. One takes a relative Path and the other a String. It uses the Path on which it is called as a parent and appends the String or relative Path appropriately.

Path parent = Paths.get("c:\\tmp");
Path child = parent.resolve("child");

Leave a Comment