aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/util
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-08 23:08:23 +0300
committerGravatar Vitaly Takmazov2016-12-08 23:20:26 +0300
commiteaf87f0422af1a1f86526ea9218cd2193202af64 (patch)
tree2fcb4f60c7cfa39c886f8dac9a49600d0d578c93 /juick-api/src/main/java/com/juick/api/util
parent34f9a7dad5535870486edb304ee8043381f7cbdd (diff)
juick-api: /post uses xmpp
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/util')
-rw-r--r--juick-api/src/main/java/com/juick/api/util/HttpUtils.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/juick-api/src/main/java/com/juick/api/util/HttpUtils.java b/juick-api/src/main/java/com/juick/api/util/HttpUtils.java
index 93fb7874..ca75eae7 100644
--- a/juick-api/src/main/java/com/juick/api/util/HttpUtils.java
+++ b/juick-api/src/main/java/com/juick/api/util/HttpUtils.java
@@ -17,6 +17,7 @@
*/
package com.juick.api.util;
+import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
@@ -46,7 +47,7 @@ public class HttpUtils {
if (attachmentType.equals("peg")) {
attachmentType = "jpg";
}
- String attachmentFName = UUID.randomUUID().toString() + "." + attachmentType;
+ String attachmentFName = DigestUtils.md5Hex(UUID.randomUUID().toString()) + "." + attachmentType;
try {
Files.write(Paths.get(tmpDir, attachmentFName),
attach.getBytes());