Returns true on success, false on failure:
JAVA:
-
public static boolean deleteDir
(File dir
) {
-
if (dir.isDirectory()) {
-
String[] children = dir.
list();
-
for (int i=0; i<children.length; i++) {
-
boolean success = deleteDir
(new File(dir, children
[i
]));
-
if (!success) {
-
return false;
-
}
-
}
-
}
-
return dir.delete();
-
}
No Comments so far
Leave a comment
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>