Possible Duplicate:
Create a temporary directory in Java
I have a test for a create DB method and I need a temp directory to put it in. The directory will be removed after the test is done. I tried using File.createTempFile()
, like so:
tempDir = File.createTempFile("install", "dir");
tempDir.mkdir();
But tempDir
is already exists as a file. How do I create a temp directory as opposed to a file?