Both java.nio.file.Path and java.io.File classes provides a way to pass from the one to the other.
1) Invoking toFile() on a Path object returns a File representing it.
Path.toFile() javadoc :
Returns a
Fileobject representing this path. Where thisPathis
associated with the default provider, then this method is equivalent
to returning aFileobject constructed with theStringrepresentation
of this path.If this path was created by invoking the
FiletoPathmethod then there
is no guarantee that theFileobject returned by this method is equal
to the original File.
2) Reversely, invoking toPath() on a File object returns a Path representing it.
File.toPath() javadoc :
Returns a
java.nio.file.Pathobject constructed from the this abstract
path. The resultingPathis associated with the default-filesystem.The first invocation of this method works as if invoking it were
equivalent to evaluating the expression:
FileSystems.getDefault().getPath(this.getPath());Subsequent invocations of this method return the same
Path.