Geo Geo - 1 year ago 115
Java Question

how can I create a temporary folder in java 6?


Possible Duplicate:

Create a temporary directory in Java




Duplicate: stackoverflow.com/questions/375910

Is there a way of creating a temporary folder in java ? I know of File's static method createTempFile, but this will only give me a temporary file.

Answer Source

I've never seen a good solution for this, but this is how I've done it.

File temp = File.createTempFile("folder-name","");
temp.delete();
temp.mkdir();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download