From c252087c54e91e63f89775eba4c65cf87ae21e5d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 28 Nov 2016 13:35:53 +0300 Subject: juick-api: cleanup --- juick-api/src/main/java/com/juick/api/util/HttpUtils.java | 12 +----------- 1 file changed, 1 insertion(+), 11 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 2fe4322d..2f8ca7c5 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 @@ -21,8 +21,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.Part; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -38,15 +36,7 @@ import java.util.UUID; */ public class HttpUtils { private static final Logger logger = LoggerFactory.getLogger(HttpUtils.class); - public static String getPartFilename(Part part) { - for (String cd : part.getHeader("content-disposition").split(";")) { - if (cd.trim().startsWith("filename")) { - String filename = cd.substring(cd.indexOf('=') + 1).trim().replace("\"", ""); - return filename.substring(filename.lastIndexOf('/') + 1).substring(filename.lastIndexOf('\\') + 1); // MSIE fix. - } - } - return null; - } + public static String receiveMultiPartFile(MultipartFile attach, String tmpDir) { if (!attach.isEmpty()) { String partname = attach.getOriginalFilename(); -- cgit v1.2.3