Here you can find the source of createTempDirectory()
public static File createTempDirectory()
//package com.java2s; //License from project: Apache License import com.google.common.base.Throwables; import java.io.File; import java.io.IOException; import java.nio.file.Files; public class Main { public static File createTempDirectory() { try {// ww w. j a va2 s . c o m final File directory = Files.createTempDirectory("sqs").toFile(); directory.deleteOnExit(); // not sure if this works return directory; } catch (IOException e) { throw Throwables.propagate(e); } } }