rishabhdaim commented on code in PR #2136:
URL: https://github.com/apache/jackrabbit-oak/pull/2136#discussion_r1979403845


##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/OakFileDataStore.java:
##########
@@ -139,12 +138,13 @@ public void addMetadataRecord(InputStream input, String 
name)
 
         try {
             File file = new File(getPath(), name);
-            FileOutputStream os = new FileOutputStream(file);
-            try {
+            try (FileOutputStream os = new FileOutputStream(file)) {
                 IOUtils.copyLarge(input, os);
             } finally {
-                Closeables.close(os, true);
-                Closeables.close(input, true);
+                try {

Review Comment:
   Shouldn't we use `IOUtils.closeQuietly` here too, since we are not doing 
anything with exception?



##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/FSBackend.java:
##########
@@ -189,12 +188,13 @@ public void addMetadataRecord(InputStream input, String 
name)
 
         try {
             File file = new File(fsPathDir, name);
-            FileOutputStream os = new FileOutputStream(file);
-            try {
+            try (FileOutputStream os = new FileOutputStream(file)) {
                 IOUtils.copyLarge(input, os);
             } finally {
-                Closeables.close(os, true);
-                Closeables.close(input, true);
+                try {

Review Comment:
   same here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to