private static File createTempDir() {
        Path basePath;
        if (new File(DEFAULT_TMP_BASE_DIR).exists()) {
            basePath = Paths.get(DEFAULT_TMP_BASE_DIR);
        } else {
            basePath = Paths.get(System.getProperty("java.io.tmpdir"));
        }

        try {
            Path tmpDir = Files.createTempDirectory(basePath, TMP_DIR_NAME);
            return tmpDir.toFile();
        } catch (IOException e) {
            throw new RuntimeException("Cannot create temp directory", e);
        }
    }
@author Tony Vaagenes
@author gjoranv
@author ollivir
standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerApplication.java