- public static void main(String[] args) {
-
- deleteFile("d:\\a");
- }
-
- public static void deleteFile(String path) {
- File file = new File(path);
- if (file.isDirectory()) {
- File[] ff = file.listFiles();
- for (int i = 0; i < ff.length; i++) {
- deleteFile(ff[i].getPath());
- }
- }
- file.delete();
- }
复制代码 |