Java Delete Directory deleteFiles(final ArrayList files)

Here you can find the source of deleteFiles(final ArrayList files)

Description

delete Files

License

Open Source License

Declaration

public static void deleteFiles(final ArrayList<File> files) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

import java.io.File;
import java.util.ArrayList;

public class Main {
    public static void deleteFiles(final ArrayList<File> files) {
        if (files == null)
            return;
        for (int i = 0; i < files.size(); i++) {
            File file = files.get(i);
            if (file == null)
                continue;
            deleteFile(file);//from   w  ww  .  j  a  v a2s.com
        }
    }

    public static void deleteFile(final File file) {
        if (file.isDirectory()) {
            for (String aChild : file.list()) {
                deleteFile(new File(file, aChild));
            }
        }
    }
}

Related

  1. deleteFiles(File parent, boolean incParent)
  2. deleteFiles(File[] files)
  3. deleteFiles(File[] files)
  4. deleteFiles(File[] intermediateFiles)
  5. deleteFiles(FileFilter filter)
  6. deleteFiles(final File directory, final String regexPattern)
  7. deleteFiles(final File file)
  8. deleteFiles(final File... files)
  9. deleteFiles(List files)