01: /*
02: * Created on 08.08.2003
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.columba.core.io;
08:
09: import java.io.File;
10:
11: /**
12: * @author fdietz
13: *
14: * <class>DirectoryIO</class> contains useful methods concerning directory
15: * operations
16: *
17: */
18: public class DirectoryIO {
19: /**
20: *
21: * recursivly delete directory
22: *
23: * @param directory
24: */
25: public static boolean delete(File directory) {
26: boolean result = false;
27:
28: if (directory.isDirectory()) {
29: File[] files = directory.listFiles();
30:
31: for (int i = 0; i < files.length; i++) {
32: if (files[i].isDirectory()) {
33: delete(files[i]);
34: }
35:
36: files[i].delete();
37: }
38:
39: result = directory.delete();
40: }
41:
42: return result;
43: }
44: }
|