Java File Delete delete(File file)

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

Description

delete

License

Open Source License

Declaration

private static void delete(File file) 

Method Source Code

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

import java.io.File;

public class Main {
    private static void delete(File file) {
        if (file.isDirectory()) {
            File[] files = file.listFiles();
            for (File file2 : files)
                delete(file2);/*from  w  ww  .ja  va2s  .  co m*/
        }
        if (!file.delete())
            throw new RuntimeException("Failed to delete file: " + file);
    }
}

Related

  1. delete(File file)
  2. delete(File file)
  3. delete(File file)
  4. delete(File file)
  5. delete(File file)
  6. delete(File file)
  7. delete(File file)
  8. delete(File file)
  9. delete(File file)