further separation of PdeEditor and PdeSketch

This commit is contained in:
benfry
2004-01-19 19:50:16 +00:00
parent 956a02ded3
commit 9f10f5f199
3 changed files with 66 additions and 219 deletions

View File

@@ -422,17 +422,22 @@ public class PdeBase {
* Remove all files in a directory and the directory itself.
*/
static public void removeDir(File dir) {
//System.out.println("removing " + dir);
removeDescendants(dir);
dir.delete();
if (dir.exists()) {
removeDescendants(dir);
dir.delete();
}
}
/**
* Recursively remove all files within a directory,
* used with removeDir().
* used with removeDir(), or when the contents of a dir
* should be removed, but not the directory itself.
* (i.e. when cleaning temp files from lib/build)
*/
static protected void removeDescendants(File dir) {
static public void removeDescendants(File dir) {
if (!dir.exists()) return;
String files[] = dir.list();
for (int i = 0; i < files.length; i++) {
if (files[i].equals(".") || files[i].equals("..")) continue;