diff options
author | Vitaly Takmazov | 2016-11-02 10:11:28 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-11-02 10:11:28 +0300 |
commit | 38071510b3888f5a4edb31705953a0995256d882 (patch) | |
tree | 201f4e19ab4747000869545db4a06046f6cd1866 /juick-www/src/main | |
parent | 83f5f448ac65735e1ae2733032ec8c0f680eb60a (diff) |
fix avatar replacing
Diffstat (limited to 'juick-www/src/main')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/Settings.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Settings.java b/juick-www/src/main/java/com/juick/www/Settings.java index 0602bff1..abe588fe 100644 --- a/juick-www/src/main/java/com/juick/www/Settings.java +++ b/juick-www/src/main/java/com/juick/www/Settings.java @@ -46,6 +46,7 @@ import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Files; +import java.nio.file.StandardCopyOption; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; @@ -161,7 +162,7 @@ public class Settings { Path ao = Paths.get(imgPath, "ao", targetName); Path a = Paths.get(imgPath, "a", targetName); Path as = Paths.get(imgPath, "as", targetName); - Files.move(Paths.get(Utils.getTmpDir(), avatarTmpPath), ao); + Files.move(Paths.get(Utils.getTmpDir(), avatarTmpPath), ao, StandardCopyOption.REPLACE_EXISTING); Thumbnails.of(ao.toFile()).size(96, 96).toFile(a.toFile()); Thumbnails.of(ao.toFile()).size(32, 32).toFile(as.toFile()); } |