/** * Create directory that is automatically cleaned up after the * JVM shuts down through use of a Runtime shutdown hook. * * @param dir Directory to create, including missing parent directories * @return File handle to the created temp directory */ public static File createTempDir(File dir) throws IOException { return createTempDir(dir, true); }
/** * Create directory that is automatically cleaned up after the * JVM shuts down through use of a Runtime shutdown hook. * * @param prefix Prefix to apply to temp directory name * @return File handle to the created temp directory * @throws IOException Unable to create temp directory */ public static File createTempDir(String prefix) throws IOException { return createTempDir(prefix, true); }
@BeforeClass public static void setUp() throws Exception { tmpDir = UnitTestHelper.createTempDir(new File("target/jsonutilstest")); configFile = UnitTestHelper.write(new File(tmpDir, "config.json"), config); }