Commit d9a2570b authored by zhangsen's avatar zhangsen

根据代码检查工具处理阻断漏洞 0224

parent b0c6ee8b
......@@ -75,20 +75,20 @@ public class FileUtils {
* @return
*/
public static String fileToZip(List<String> list, String fileName, String ipUrl) {
InputStream fis = null;
BufferedInputStream bis = null;
FileOutputStream fos = null;
ZipOutputStream zos = null;
// 临时目录
String path = System.getProperty("java.io.tmpdir") + fileName;
try {
File zipFile = new File(path);
zipFile.deleteOnExit();
try {
zipFile.createNewFile();
fos = new FileOutputStream(zipFile);
zos = new ZipOutputStream(new BufferedOutputStream(fos));
} catch (IOException e) {
e.printStackTrace();
}
InputStream fis = null;
BufferedInputStream bis = null;
try (
FileOutputStream fos = new FileOutputStream(zipFile);
ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(fos));) {
byte[] bufs = new byte[1024 * 10];
for (String a : list) {
fis = getInputStreamFromURL(ipUrl + a);
......@@ -105,9 +105,6 @@ public class FileUtils {
}
}
System.out.println("压缩成功");
} catch (FileNotFoundException e) {
e.printStackTrace();
throw new RuntimeException(e);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
......@@ -116,12 +113,11 @@ public class FileUtils {
if (null != bis) {
bis.close();
}
if (null != zos) {
zos.close();
if (null != fis) {
fis.close();
}
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
return path;
......
......@@ -108,9 +108,8 @@ public class SignController extends BaseController {
signDto.setPersonPhotos(personImg.get(0).getValue());
} catch (Exception e) {
e.printStackTrace();
} finally {
return ResponseHelper.buildResponse(signDto);
}
return ResponseHelper.buildResponse(signDto);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment