Here you can find the source of delete(File f)
Parameter | Description |
---|---|
f | The file or directory to delete. |
public static boolean delete(File f)
//package com.java2s; // * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * import java.io.*; public class Main { /**/* www . j ava2 s .co m*/ * Recursively deletes a file or directory. * * @param f The file or directory to delete. * @return <jk>true</jk> if file or directory was successfully deleted. */ public static boolean delete(File f) { if (f == null) return true; if (f.isDirectory()) { File[] cf = f.listFiles(); if (cf != null) for (File c : cf) delete(c); } return f.delete(); } }