Java File Path Delete delete(final File path)

Here you can find the source of delete(final File path)

Description

delete

License

Apache License

Declaration

public static void delete(final File path) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {
    public static void delete(final File path) {
        final String[] files = path.list();
        String parentPath = path.getPath();
        for (final String name : files) {
            final File file = new File(parentPath, name);
            if (file.isDirectory()) {
                delete(file);/*w w w  . jav a 2  s .  c  o  m*/
            }
            file.delete();
        }
        path.delete();
    }
}

Related

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