Commit d9a2570b authored by zhangsen's avatar zhangsen

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

parent b0c6ee8b
...@@ -75,20 +75,20 @@ public class FileUtils { ...@@ -75,20 +75,20 @@ public class FileUtils {
* @return * @return
*/ */
public static String fileToZip(List<String> list, String fileName, String ipUrl) { 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; String path = System.getProperty("java.io.tmpdir") + fileName;
try {
File zipFile = new File(path); File zipFile = new File(path);
zipFile.deleteOnExit(); zipFile.deleteOnExit();
try {
zipFile.createNewFile(); zipFile.createNewFile();
} catch (IOException e) {
fos = new FileOutputStream(zipFile); e.printStackTrace();
zos = new ZipOutputStream(new BufferedOutputStream(fos)); }
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]; byte[] bufs = new byte[1024 * 10];
for (String a : list) { for (String a : list) {
fis = getInputStreamFromURL(ipUrl + a); fis = getInputStreamFromURL(ipUrl + a);
...@@ -105,9 +105,6 @@ public class FileUtils { ...@@ -105,9 +105,6 @@ public class FileUtils {
} }
} }
System.out.println("压缩成功"); System.out.println("压缩成功");
} catch (FileNotFoundException e) {
e.printStackTrace();
throw new RuntimeException(e);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(e); throw new RuntimeException(e);
...@@ -116,12 +113,11 @@ public class FileUtils { ...@@ -116,12 +113,11 @@ public class FileUtils {
if (null != bis) { if (null != bis) {
bis.close(); bis.close();
} }
if (null != zos) { if (null != fis) {
zos.close(); fis.close();
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(e);
} }
} }
return path; return path;
......
...@@ -108,9 +108,8 @@ public class SignController extends BaseController { ...@@ -108,9 +108,8 @@ public class SignController extends BaseController {
signDto.setPersonPhotos(personImg.get(0).getValue()); signDto.setPersonPhotos(personImg.get(0).getValue());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); 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