aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-28 13:35:53 +0300
committerGravatar Vitaly Takmazov2016-11-28 13:35:53 +0300
commitc252087c54e91e63f89775eba4c65cf87ae21e5d (patch)
treeee00101ee8b4fc3c62bc8ec5f9f247ff32024d0c /juick-api/src
parentf9e9dc9daf7393fe5753e24bff051760981552e6 (diff)
juick-api: cleanup
Diffstat (limited to 'juick-api/src')
-rw-r--r--juick-api/src/main/java/com/juick/api/util/HttpUtils.java12
1 files changed, 1 insertions, 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();