File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
platform-api/src/main/java/com/flow/platform/api/util Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change 1717package com .flow .platform .api .util ;
1818
1919import com .flow .platform .api .config .AppConfig ;
20- import java .io .IOException ;
2120import java .io .InputStream ;
2221import java .math .BigInteger ;
2322import java .time .LocalDateTime ;
2423import java .time .format .DateTimeFormatter ;
2524import java .util .UUID ;
2625import org .apache .commons .io .IOUtils ;
2726import org .springframework .web .multipart .MultipartFile ;
28- import org .springframework .web .multipart .commons .CommonsMultipartFile ;
2927
3028/**
3129 * @author yh@firim
@@ -52,8 +50,7 @@ public synchronized static BigInteger randomId() {
5250 * @return
5351 */
5452 public static String commonsMultipartFileToString (MultipartFile file ) {
55- try {
56- InputStream is = file .getInputStream ();
53+ try (InputStream is = file .getInputStream ()) {
5754 return IOUtils .toString (is , AppConfig .DEFAULT_CHARSET .name ());
5855 } catch (Throwable throwable ) {
5956 return null ;
You can’t perform that action at this time.
0 commit comments