public static void cleanupDir(String dirPath,List<String> childdirs) throws IOException {
  if (childdirs == null || childdirs.size() == 0)   FileUtils.cleanDirectory(new File(dirPath));
 else {
    for (    String cdir : childdirs)     FileUtils.cleanDirectory(new File(dirPath + "/" + cdir));
  }
}

public static void cleanupDir ( String dirPath , List < String > childdirs ) throws IOException { if ( childdirs == null || childdirs . size ( ) == 0 ) FileUtils . cleanDirectory ( new File ( dirPath ) ) ; else { for ( String cdir : childdirs ) FileUtils . cleanDirectory ( new File ( dirPath + "/" + cdir ) ) ; } }
delete all the files / dirs in the given directory but dont delete the dir itself .
