Concatenating Path

In Java 7 a new file api was introduced. This new file api is represented by the java.nio package. With the old api java.io it was possible to concatenate two file/folder easily. Let’s have a look how this works with the java.nio.file.Path

With java.io.File it was possible to use

A concatenation like that is not apparently available in java.nio.file.Path. But when having a look at it there is a method called resolve. Using Path.resolve it is possible to concatenate different paths.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.