From eaf87f0422af1a1f86526ea9218cd2193202af64 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 8 Dec 2016 23:08:23 +0300 Subject: juick-api: /post uses xmpp --- juick-api/src/main/java/com/juick/api/util/HttpUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'juick-api/src/main/java/com/juick/api/util') 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()); -- cgit v1.2.3