diff options
author | Vitaly Takmazov | 2018-05-17 22:39:28 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-05-17 22:39:28 +0300 |
commit | 235bb5b9fc7072531f19cc25c3b07258198d86ec (patch) | |
tree | 127e6c113fe04978ff3c43bee9d6da2fa9e1c6d5 /juick-common/src/main/java/com/juick/service | |
parent | c3f5d83b7beed8a523b8a851df742ef028de5efd (diff) |
ImagesService refactoring
Diffstat (limited to 'juick-common/src/main/java/com/juick/service')
-rw-r--r-- | juick-common/src/main/java/com/juick/service/ImagesService.java | 2 | ||||
-rw-r--r-- | juick-common/src/main/java/com/juick/service/ImagesServiceImpl.java | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/juick-common/src/main/java/com/juick/service/ImagesService.java b/juick-common/src/main/java/com/juick/service/ImagesService.java index 192217fe..902301ed 100644 --- a/juick-common/src/main/java/com/juick/service/ImagesService.java +++ b/juick-common/src/main/java/com/juick/service/ImagesService.java @@ -5,7 +5,7 @@ import com.juick.Message; import java.io.IOException; public interface ImagesService { - void setAttachmentMetadata(String imgDir, String baseUrl, Message msg) throws Exception; + void setAttachmentMetadata(String baseUrl, Message msg) throws Exception; /** * Move attached image from temp folder to image folder. * Create preview images in corresponding folders. diff --git a/juick-common/src/main/java/com/juick/service/ImagesServiceImpl.java b/juick-common/src/main/java/com/juick/service/ImagesServiceImpl.java index dbc3f3a9..67c8360e 100644 --- a/juick-common/src/main/java/com/juick/service/ImagesServiceImpl.java +++ b/juick-common/src/main/java/com/juick/service/ImagesServiceImpl.java @@ -12,11 +12,15 @@ import java.nio.file.Paths; public class ImagesServiceImpl implements ImagesService { private ImageUtils imageUtils; + private String imgDir; + private String tmpDir; public ImagesServiceImpl(String imgDir, String tmpDir) { + this.imgDir = imgDir; + this.tmpDir = tmpDir; imageUtils = new ImageUtils(imgDir, tmpDir); } @Override - public void setAttachmentMetadata(String imgDir, String baseUrl, Message msg) throws Exception { + public void setAttachmentMetadata(String baseUrl, Message msg) throws Exception { if (!StringUtils.isEmpty(msg.getAttachmentType())) { Photo photo = new Photo(); if (msg.getRid()> 0) { |