Java Delete Directory deleteFiles(String dir, String... files)

Here you can find the source of deleteFiles(String dir, String... files)

Description

delete Files

License

Open Source License

Declaration

public static void deleteFiles(String dir, String... files) 

Method Source Code


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

import java.io.File;

public class Main {
    public static void deleteFiles(String dir, String... files) {
        if (!dir.endsWith(File.separator)) {
            dir += File.separator;
        }//from  w  w  w .jav  a 2  s  .  c o  m

        for (String file : files) {
            new File(dir + file).delete();
        }
    }
}

Related

  1. deleteFiles(final File directory, final String regexPattern)
  2. deleteFiles(final File file)
  3. deleteFiles(final File... files)
  4. deleteFiles(List files)
  5. deleteFiles(String dir)
  6. deleteFiles(String directory, FileFilter filter, boolean recursive)
  7. deleteFiles(String directoryName)
  8. deleteFiles(String fileName)
  9. deleteFiles(String root, String mask)