|
|
|
@@ -96,19 +96,21 @@ public class Deltree extends Task { |
|
|
|
// check to make sure that the given dir isn't a symlink |
|
|
|
// the comparison of absolute path and canonical path |
|
|
|
// catches this |
|
|
|
|
|
|
|
if (dir.getCanonicalPath().equals(dir.getAbsolutePath())) { |
|
|
|
String[] list = dir.list(); |
|
|
|
for (int i = 0; i < list.length; i++) { |
|
|
|
String s = list[i]; |
|
|
|
File f = new File(dir, s); |
|
|
|
if (f.isDirectory()) { |
|
|
|
removeDir(f); |
|
|
|
} else { |
|
|
|
f.delete(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// if (dir.getCanonicalPath().equals(dir.getAbsolutePath())) { |
|
|
|
// (costin) It will not work if /home/costin is symlink to /da0/home/costin ( taz |
|
|
|
// for example ) |
|
|
|
String[] list = dir.list(); |
|
|
|
for (int i = 0; i < list.length; i++) { |
|
|
|
String s = list[i]; |
|
|
|
File f = new File(dir, s); |
|
|
|
if (f.isDirectory()) { |
|
|
|
removeDir(f); |
|
|
|
} else { |
|
|
|
f.delete(); |
|
|
|
} |
|
|
|
} |
|
|
|
// } |
|
|
|
dir.delete(); |
|
|
|
} |
|
|
|
} |
|
|
|
|