From a8bca3dc1232b4f60904dd25d7cd2075f8f1aaed Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 31 May 2016 11:07:02 +0200 Subject: [PATCH] fix sonar issue unused local variable Signed-off-by: Michael Hirsch --- .../hawkbit/artifact/repository/ArtifactStore.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hawkbit-artifact-repository-mongo/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactStore.java b/hawkbit-artifact-repository-mongo/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactStore.java index 5f12498ff..af60a39c8 100644 --- a/hawkbit-artifact-repository-mongo/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactStore.java +++ b/hawkbit-artifact-repository-mongo/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactStore.java @@ -124,11 +124,9 @@ public class ArtifactStore implements ArtifactRepository { try { LOGGER.debug("storing file {} of content {}", filename, contentType); tempFile = File.createTempFile("uploadFile", null); - try (final FileOutputStream os = new FileOutputStream(tempFile)) { - try (BufferedOutputStream bos = new BufferedOutputStream(os)) { - try (BufferedInputStream bis = new BufferedInputStream(content)) { - return store(content, contentType, bos, tempFile, hash); - } + try (final BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(tempFile))) { + try (BufferedInputStream bis = new BufferedInputStream(content)) { + return store(bis, contentType, bos, tempFile, hash); } } } catch (final IOException | MongoException e1) {