Here you can find the source of resolveRelativePath(String first, String... more)
private static Path resolveRelativePath(String first, String... more)
//package com.java2s; //License from project: Apache License import java.nio.file.Path; import java.nio.file.Paths; public class Main { private static Path resolveRelativePath(String first, String... more) { String workingDirName = System.getProperty("user.dir"); if (workingDirName == null) { throw new IllegalStateException("Working directory yet defined"); }//from w w w . j a v a 2 s. c o m Path workingDir = Paths.get(workingDirName); Path path = workingDir.resolve(first); if (more != null) { for (String part : more) { path = path.resolve(part); } } return path; } }