aboutsummaryrefslogtreecommitdiff
path: root/juick-server-web/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-08-21 12:32:18 +0300
committerGravatar Vitaly Takmazov2017-08-21 12:32:18 +0300
commit265e116a3410273a33d7dc1bde892eb65fba8472 (patch)
tree0c873b89199d0ee537c24f752ee41fc46a17d9da /juick-server-web/src/main/java/com/juick
parentda810028a322d80cddb75ab024bedcd077c76a0b (diff)
api: cleanup unused injections
Diffstat (limited to 'juick-server-web/src/main/java/com/juick')
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java b/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java
index bf08f31e..971587a8 100644
--- a/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java
@@ -17,6 +17,7 @@
package com.juick.server.util;
import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -82,11 +83,7 @@ public class HttpUtils {
attachmentFName = DigestUtils.md5Hex(UUID.randomUUID().toString()) + "." + attachmentType;
fos = new FileOutputStream(Paths.get(tmpDir, attachmentFName).toString());
- byte[] buffer = new byte[10240];
- int len;
- while ((len = is.read(buffer)) > 0) {
- fos.write(buffer, 0, len);
- }
+ IOUtils.copy(is, fos);
} catch (Exception e) {
ex = e;
attachmentFName = null;