cancel
Showing results for 
Search instead for 
Did you mean: 

Couldn't delete Temp dirs after running Creating Artifact

littletaffer
Champ in-the-making
Champ in-the-making
Hi there,

While debugging the create artifact function, I noticed that two of these lines appeared in DeploymentMenu version 5.9:

tempbarFolder.delete(true, null);
tempclassesFolder.delete(true, null);

These two lines are not in 5.8 - as it is used as the base for our work on customizing the RCP.

I added that two lines above below the "deployment.refreshLocal". It causes a ResourceException error like:

org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
   at org.eclipse.core.internal.resources.Resource.delete(Resource.java:793)
   at org.eclipse.core.internal.resources.Resource.delete(Resource.java:746)
   at workfloweditor.common.DeploymentMenu$1.run(DeploymentMenu.java:139)
   at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Contains: Could not delete '/test34/tempbar'.
org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
   at org.eclipse.core.internal.localstore.FileSystemResourceManager.delete(FileSystemResourceManager.java:352)
   at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFolder(ResourceTree.java:352)
   at org.eclipse.core.internal.resources.ResourceTree.standardDeleteFolder(ResourceTree.java:798)
   at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1941)
   at org.eclipse.core.internal.resources.Resource.delete(Resource.java:780)
   at org.eclipse.core.internal.resources.Resource.delete(Resource.java:746)
   at workfloweditor.common.DeploymentMenu$1.run(DeploymentMenu.java:139)
   at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Contains: Problems encountered while deleting files.
Contains: Could not delete: C:\runtime-workfloweditor.product\test34\tempbar\workflow1.bpmn20.xml.
Contains: Could not delete: C:\runtime-workfloweditor.product\test34\tempbar.
Interestingly, this problem doesn't occur when running in the Apple OS platform.

I remembered reading a past post that the two lines added above was based on a suggestion to clean off temp folders. In Windows presently we can't remove those. Could it be due to different resource handling or it might be an unexpected bug?

Did I miss out something in the designer code related to this func or do I have to turn off some setting at the machine / OS level?
3 REPLIES 3

littletaffer
Champ in-the-making
Champ in-the-making
It looks like there's a bug inside the zipDirectory function. The FileInputStream and the ZipOutputStream instance was not closed. This gives error in Windows platform.

trademak
Star Contributor
Star Contributor
The ZipOutputStream is closed in the finally statement. The FileInputStream wasn't closed, I committed a fix for that.
If it still doesn't work with version 5.9.3 (which I'll release tomorrow), please create a JIRA.

Best regards,

littletaffer
Champ in-the-making
Champ in-the-making
Hi Tijs,

The code works fine. From my side, I have also added the out.close() after the out.closeEntry() as an extra measure in case. It would be better to add that one line in there.