Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-12-11 11:13:13 -0500
committerEike Stepper2015-12-11 11:13:13 -0500
commita3359af34658cec0d2579684138677c66b72b533 (patch)
treeb859e52afcab07ff882c71f625a196cab39fe045
parentcf28e9e456fdb412a7a03a8f0a6e123565475b06 (diff)
downloaduss-a3359af34658cec0d2579684138677c66b72b533.tar.gz
uss-a3359af34658cec0d2579684138677c66b72b533.tar.xz
uss-a3359af34658cec0d2579684138677c66b72b533.zip
Create cache file in rertieveBlob if it doesn't already exist
-rw-r--r--org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java15
1 files changed, 10 insertions, 5 deletions
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 @@ public final class Storage implements IStorage
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)
{

Back to the top