mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-27 10:55:33 +02:00
[189214] fix profile deletion in the metadata area
This commit is contained in:
parent
330f6c9bda
commit
6a1b7a5eb8
1 changed files with 16 additions and 1 deletions
|
@ -27,7 +27,7 @@ class PFMetadataAnchor implements PFPersistenceAnchor {
|
||||||
IStatus result = Status.OK_STATUS;
|
IStatus result = Status.OK_STATUS;
|
||||||
File profileFolder = getProfileFolder(profileName);
|
File profileFolder = getProfileFolder(profileName);
|
||||||
if (profileFolder.exists()) {
|
if (profileFolder.exists()) {
|
||||||
profileFolder.delete();
|
delete(profileFolder);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -91,4 +91,19 @@ class PFMetadataAnchor implements PFPersistenceAnchor {
|
||||||
return folder;
|
return folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a File resource. If the resource is a directory then
|
||||||
|
* delete its children first.
|
||||||
|
* @param resource
|
||||||
|
*/
|
||||||
|
private void delete(File resource) {
|
||||||
|
if (resource.isDirectory()) {
|
||||||
|
File[] resources = resource.listFiles();
|
||||||
|
for (int i = 0; i < resources.length; i++) {
|
||||||
|
File child = resources[i];
|
||||||
|
delete(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resource.delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue