Create cache file in rertieveBlob if it doesn't already exist
diff --git a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java
index b3d1721..1e63f95 100644
--- a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java
+++ b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java
@@ -376,19 +376,24 @@
           cacheStream = null; // Avoid closing the result stream in the finally block
           return cacheStreamResult;
         }
+      }
 
+      IOUtil.closeSilent(cacheStream);
+
+      if (cache != null)
+      {
         OutputStream output = cache.internalGetOutputStream(applicationToken, key, properties);
-        return new TeeInputStream(contents, output);
+        if (output != null)
+        {
+          return new TeeInputStream(contents, output);
+        }
       }
 
       return contents;
     }
     catch (NotFoundException ex)
     {
-      if (cacheStream != null)
-      {
-        IOUtil.closeSilent(cacheStream);
-      }
+      IOUtil.closeSilent(cacheStream);
 
       if (cache != null)
       {