Java Delete Temp Directory deleteTestDirectory(File testDir)

Here you can find the source of deleteTestDirectory(File testDir)

Description

delete Test Directory

License

Apache License

Declaration

public static void deleteTestDirectory(File testDir) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {
    public static void deleteTestDirectory(File testDir) {
        delete(testDir);//from  w  ww.j  a  v a2  s  . co m
        testDir.getParentFile().delete(); // Delete if empty
    }

    public static void delete(File f) {
        if (f.isDirectory())
            for (File child : f.listFiles())
                delete(child);
        f.delete();
    }
}

Related

  1. deleteTempDirectory(File dir)
  2. deleteTempMapset(String mapsetFolder)
  3. deleteTemporaryDirectory(String dir)
  4. deleteTestData()
  5. deleteTestDir(final File file)
  6. deleteTestFile(String fileName)
  7. deleteTestFiles()
  8. deleteTestFolder()