@@ -54,7 +54,9 @@ public class BASE64DecodedMultipartFile implements MultipartFile {
@Override
public void transferTo(File dest) throws IOException, IllegalStateException {
- new FileOutputStream(dest).write(imgContent);
+ try (FileOutputStream ios = new FileOutputStream(dest)){
+ ios.write(imgContent);
+ }
}