Java Delete Directory deleteFiles(File file)

Here you can find the source of deleteFiles(File file)

Description

Remove com recursividade.

License

Open Source License

Parameter

Parameter Description
file a parameter

Declaration

private static void deleteFiles(File file) 

Method Source Code

    //package com.java2s;
    //License from project: Open Source License 

    import java.io.File;
    import java.util.stream.Stream;

    public class Main {
        /**/*from   w  w w.  j  ava  2s  .  c om*/
         * Remove com recursividade.
         *
         * @param file
         */
        private static void deleteFiles(File file) {
    File[] listFiles = file.listFiles();
    Stream.of(listFiles).parallel().forEach(f -> {
        if (f.isDirectory()) {
            deleteFiles(f);
        }
        f.delete();
    });
}
    }

Related

  1. deleteFiles(File directory)
  2. deleteFiles(File directory)
  3. deleteFiles(File directory, String prefix)
  4. deleteFiles(File docFolder)
  5. deleteFiles(File f, boolean del_self)
  6. deleteFiles(File folder)
  7. deleteFiles(File folder)
  8. deleteFiles(File parent, boolean incParent)
  9. deleteFiles(File[] files)