Java File Path Delete delete(String filePath)

Here you can find the source of delete(String filePath)

Description

delete

License

Creative Commons License

Declaration

public static boolean delete(String filePath) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

import java.io.File;

public class Main {
    public static boolean delete(String filePath) {
        return delete(new File(filePath));
    }//from w  w  w. j a va  2 s  .  c o m

    public static boolean delete(File file) {
        if (file.isDirectory()) {
            File[] files = file.listFiles();

            for (File innerFile : files) {
                delete(innerFile);
            }
        }

        return file.delete();
    }
}

Related

  1. delete(final File path)
  2. delete(String fileNameWithFullPath)
  3. delete(String filePath)
  4. delete(String filePath)
  5. delete(String filePath)
  6. delete(String filePath, boolean recursive)
  7. delete(String path)
  8. delete(String path)
  9. delete(String path)