Here you can find the source of deleteTemporaryDirectory(String dir)
public static void deleteTemporaryDirectory(String dir)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static void deleteTemporaryDirectory(String dir) { File tmpDir = new File(dir); for (File f : tmpDir.listFiles()) { f.delete();//from ww w . j a va 2 s .c o m } tmpDir.delete(); File tmpParentDir = tmpDir.getParentFile(); if (tmpParentDir.isDirectory() && tmpParentDir.getName().equals("tmp")) { tmpParentDir.delete(); } } }