From bd05298faca4bd7f128281fa3261fb1b2c94d791 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 11 Apr 2018 14:21:12 +0300 Subject: server: fix moving unreadable files --- juick-common/src/main/java/com/juick/server/util/ImageUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'juick-common/src/main/java') diff --git a/juick-common/src/main/java/com/juick/server/util/ImageUtils.java b/juick-common/src/main/java/com/juick/server/util/ImageUtils.java index 41455da4..71dec381 100644 --- a/juick-common/src/main/java/com/juick/server/util/ImageUtils.java +++ b/juick-common/src/main/java/com/juick/server/util/ImageUtils.java @@ -153,7 +153,8 @@ public class ImageUtils { attachment.setHeight(info.getHeight()); attachment.setWidth(info.getWidth()); } catch (ImageReadException e) { - logger.info("Can not read {}, moved to {}", imageFile.toPath(), Files.move(imageFile.toPath(), Paths.get(tmpDir), StandardCopyOption.REPLACE_EXISTING)); + logger.info("Can not read {}, moved to {}", imageFile.toPath(), + Files.move(imageFile.toPath(), Paths.get(tmpDir, imageFile.getName()), StandardCopyOption.REPLACE_EXISTING)); } } return attachment; -- cgit v1.2.3