You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by si...@apache.org on 2019/10/16 11:18:08 UTC

[camel] branch camel-2.x updated: CAMEL-14072 FileInputStreamCache does not delete file if file system is full

This is an automated email from the ASF dual-hosted git repository.

siano pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.x by this push:
     new 6223a78  CAMEL-14072 FileInputStreamCache does not delete file if file system is full
6223a78 is described below

commit 6223a78ebcc5dc3610e2b7aacb7da62742677f2f
Author: Stephan Siano <st...@sap.com>
AuthorDate: Wed Oct 16 13:03:32 2019 +0200

    CAMEL-14072 FileInputStreamCache does not delete file if file system is full
    
    Thanks to André Weickel for reporting and proposed fix
---
 .../apache/camel/converter/stream/FileInputStreamCache.java    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java b/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
index f778c99..8e38495 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
@@ -202,14 +202,14 @@ public final class FileInputStreamCache extends InputStream implements StreamCac
                                 if (outputStream != null) {
                                     outputStream.close();
                                 }
-                                try {
-                                    cleanUpTempFile();
-                                } catch (Exception e) {
-                                    LOG.warn("Error deleting temporary cache file: " + tempFile + ". This exception will be ignored.", e);
-                                }
                             } catch (Exception e) {
                                 LOG.warn("Error closing streams. This exception will be ignored.", e);
                             }
+                            try {
+                                cleanUpTempFile();
+                            } catch (Exception e) {
+                                LOG.warn("Error deleting temporary cache file: " + tempFile + ". This exception will be ignored.", e);
+                            }
                         }
                     }