Here you can find the source of getTempDirectory()
public static String getTempDirectory() throws IOException
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.io.File; import java.io.IOException; public class Main { /**/*from ww w.java 2 s.com*/ * Returns the absolute path of a temp directory. The directory is *not* created. */ public static String getTempDirectory() throws IOException { final File temp = File.createTempFile("temp", Long.toString(System.nanoTime())); if (!(temp.delete())) { throw new IOException("Could not delete temp file: " + temp.getAbsolutePath()); } return temp.getAbsolutePath(); } }