Here you can find the source of toPath(String value, Path defaultValue)
public static Path toPath(String value, Path defaultValue)
//package com.java2s; //License from project: Apache License import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static Path toPath(String value, Path defaultValue) { if (value == null || value.length() == 0) { return defaultValue; }// w w w . j ava2 s . c om return Paths.get(value); } }