Ver código fonte

Merge branch 'fix/codeutil' into 'wrdp'

使用closeable关闭

See merge request o2oa/o2oa!2294
o2null 5 anos atrás
pai
commit
e57f8bc0cd

+ 3 - 3
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/personcard/CodeUtil.java

@@ -214,9 +214,9 @@ public class CodeUtil {
 	 */
 	public static File decoderBase64File(String targetPath, String base64Code) throws Exception {
 		byte[] buffer = Base64.decodeBase64(base64Code);
-		FileOutputStream out = new FileOutputStream(targetPath);
-		out.write(buffer);
-		out.close();
+		try (FileOutputStream out = new FileOutputStream(targetPath)) {
+			out.write(buffer);
+		}
 		File file = new File(targetPath);
 		return file;
 	}