Here you can find the source of deleteFiles(final File pathname)
Parameter | Description |
---|---|
directory | a parameter |
protected static void deleteFiles(final File pathname)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*from ww w. j ava 2 s .co m*/ * Description goes here. * * @param directory */ protected static void deleteFiles(final File pathname) { if (pathname.isDirectory()) { for (File file : pathname.listFiles()) { if (file.isFile()) { file.delete(); } else if (file.isDirectory() && !".".equals(file.getName()) && !"..".equals(file.getName())) { deleteFiles(file); } } pathname.delete(); } } }