Here you can find the source of initializePath(String... envVarNames)
private static void initializePath(String... envVarNames) throws FileNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileNotFoundException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; public class Main { public static final String SUBDIRECTORY = "HookAnyText"; public static final Map<String, Path> DRICTORIES = new HashMap<>(); private static void initializePath(String... envVarNames) throws FileNotFoundException { String keyEnvVarName = envVarNames[0]; Path p = DRICTORIES.get(keyEnvVarName); if (p != null) return; String directory = null;/*from www.j a v a 2 s . c o m*/ for (int i = 0; i < envVarNames.length && directory == null; ++i) { directory = System.getenv(envVarNames[i]); } if (directory == null) { throw new FileNotFoundException("No " + keyEnvVarName + " directory found."); } p = Paths.get(directory, SUBDIRECTORY); new File(p.toString()).mkdirs(); DRICTORIES.put(keyEnvVarName, p); } }