Google Guava is a java library with lot of utilities and reusable components. This requires the library guava-10.0.jar to be in classpath. The following example shows using Files.createTempDir() API.
package com.bethecoder.tutorials.guava.io_tests; import java.io.File; import java.io.IOException; import com.google.common.io.Files; public class TempDirTest { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { File tmpDir = Files.createTempDir(); System.out.println(tmpDir); } }
C:\DOCUME~1\VSUDHA~1\LOCALS~1\Temp\1321996559515-0