ResourceRoot (Path baseDir, String relativePath) { Path root = convertToAbsolute(baseDir, relativePath); if (Files.isRegularFile(root)) { return new JarResourceRoot(root); } return new DirectoryResourceRoot(root); }