Here you can find the source of deleteFolderAndContent(String folderPath)
Parameter | Description |
---|---|
folderPath | a parameter |
public static void deleteFolderAndContent(String folderPath)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*from w ww. j a v a 2 s . c o m*/ * Function that deletes a folder and its content. * @param folderPath */ public static void deleteFolderAndContent(String folderPath) { File index = new File(folderPath); String[] entries = index.list(); for (String s : entries) { File currentFile = new File(index.getPath(), s); currentFile.delete(); } index.delete(); } }