Fixed unwanted link following in project deletion that led to deleting

the game source's drawable folder. First steps towards enhancements of
export package generation.
This commit is contained in:
Zukero
2017-12-17 22:40:46 +01:00
parent 259442710b
commit a475180bb5
3 changed files with 177 additions and 23 deletions

View File

@@ -4,6 +4,7 @@ import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
@@ -332,7 +333,9 @@ public class Workspace implements ProjectTreeNode, Serializable {
private static boolean delete(File f) {
boolean b = true;
if (f.isDirectory()) {
if (Files.isSymbolicLink(f.toPath())) {
b &= f.delete();
} else if (f.isDirectory()) {
for (File c : f.listFiles())
b &= delete(c);
}