Here you can find the source of createTempDirectory()
public static File createTempDirectory() throws IOException
//package com.java2s; import java.io.File; import java.io.IOException; public class Main { public static File createTempDirectory() throws IOException { File dir = File.createTempFile("temp", Long.toString(System.nanoTime())); if (!(dir.delete())) throw new IOException("Could not delete temp file: " + dir.getAbsolutePath()); if (!(dir.mkdir())) throw new IOException("Could not create temp directory: " + dir.getAbsolutePath()); return (dir); }/*from ww w. j a v a 2 s. co m*/ }