private File getDestPath(File rootDir, String javaPackage) {
        File dir = rootDir;
        for (String subDir : javaPackage.split("\\.")) {
            dir = new File(dir, subDir);
            synchronized (this) {
                if (!dir.isDirectory() && !dir.mkdir()) {
                    throw new CodegenRuntimeException("Could not create " + dir.getPath());
                }
            }
        }
        return dir;
    }
@param rootDir the root directory for the destination path.
@param javaPackage the java package
@return the destination path for the generated config file, including the given rootDir.
configgen/src/main/java/com/yahoo/config/codegen/JavaClassBuilder.java