o2null 5 лет назад
Родитель
Сommit
26bfee3e94

+ 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;
 	}