Java File Delete delete(File f)

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

Description

delete

License

Apache License

Declaration

public static void delete(File f) 

Method Source Code


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

import java.io.File;

public class Main {
    public static void delete(File f) {

        if (!f.exists())
            throw new IllegalArgumentException("Delete: no such file or directory: " + f.getName());

        boolean success = f.delete();

        if (!success)
            throw new IllegalArgumentException("Delete: deletion failed: " + f.getAbsolutePath());
    }/*w  w w.ja  va2  s  . c om*/
}

Related

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