FELIX-1861: FileInstall created temp directories are never deleted

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@891449 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
index 52ce8fe..ffce643 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
@@ -491,6 +491,7 @@
                 if (!f.exists() && f.mkdirs())
                 {
                     tmpDir = f;
+                    tmpDir.deleteOnExit();
                     break;
                 }
             }
@@ -663,6 +664,12 @@
     {
         this.context.removeBundleListener(this);
         interrupt();
+        for (Iterator iter = currentManagedArtifacts.values().iterator(); iter.hasNext();)
+        {
+            Artifact artifact = (Artifact) iter.next();
+            deleteTransformedFile(artifact);
+            deleteJaredDirectory(artifact);
+        }
         try
         {
             join(10000);