private static <T> T withTempDir(ThrowingFunction<File, T> f) throws Exception {
        File tmpDir = createTempDir();
        try {
            return f.apply(tmpDir);
        } finally {
            IOUtils.recursiveDeleteDir(tmpDir);
        }
    }
@author Tony Vaagenes
@author gjoranv
@author ollivir
standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerApplication.java