From f3312679fa538122cd81e0e9a0a251ebb296b80e Mon Sep 17 00:00:00 2001 From: KillyMXI Date: Tue, 20 Jun 2017 01:41:58 +0300 Subject: HttpUtils.downloadImage() takes additional argument, one hardcoded path less --- juick-server/src/main/java/com/juick/server/util/HttpUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main') diff --git a/juick-server/src/main/java/com/juick/server/util/HttpUtils.java b/juick-server/src/main/java/com/juick/server/util/HttpUtils.java index e54bef87..c305093c 100644 --- a/juick-server/src/main/java/com/juick/server/util/HttpUtils.java +++ b/juick-server/src/main/java/com/juick/server/util/HttpUtils.java @@ -61,7 +61,7 @@ public class HttpUtils { } return StringUtils.EMPTY; } - public static String downloadImage(URL url) throws Exception { + public static String downloadImage(URL url, String tmpDir) throws Exception { String attachmentFName = null; Exception ex = null; @@ -82,7 +82,7 @@ public class HttpUtils { } attachmentFName = UUID.randomUUID().toString() + "." + attachmentType; - fos = new FileOutputStream("/var/www/juick.com/i/tmp/" + attachmentFName); + fos = new FileOutputStream(Paths.get(tmpDir, attachmentFName).toString()); byte[] buffer = new byte[10240]; int len; while ((len = is.read(buffer)) > 0) { -- cgit v1.2.3