Commit 5fc5a75a authored by rbioteau's avatar rbioteau
Browse files

BS-14177

Do not delete folder (only files) when applying a look n feel
parent 27b7ea65
...@@ -36,6 +36,7 @@ import org.bonitasoft.studio.pics.Pics; ...@@ -36,6 +36,7 @@ import org.bonitasoft.studio.pics.Pics;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
...@@ -495,9 +496,17 @@ public class ApplicationResourceFileStore extends AbstractFileStore implements I ...@@ -495,9 +496,17 @@ public class ApplicationResourceFileStore extends AbstractFileStore implements I
public void clear() { public void clear() {
try { try {
for (final IResource toDelete : getResourcesApplicationFolder().members()) { getResourcesApplicationFolder().accept(new IResourceVisitor() {
toDelete.delete(true, Repository.NULL_PROGRESS_MONITOR);
} @Override
public boolean visit(IResource resource) throws CoreException {
if (resource instanceof IFile) {
resource.delete(true, Repository.NULL_PROGRESS_MONITOR);
BonitaStudioLog.debug(resource.getName() + " has been deleted.", Activator.PLUGIN_ID);
}
return true;
}
});
deleteIfExists(getConfirmationTemplate()); deleteIfExists(getConfirmationTemplate());
deleteIfExists(getConsultationTemplate()); deleteIfExists(getConsultationTemplate());
deleteIfExists(getErrorTemplate()); deleteIfExists(getErrorTemplate());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment