You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2019/07/10 11:21:56 UTC

[tika] 02/02: TIKA-2903 -- close RereadableStream's storeOutputStream via Peter Fassev

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

tallison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git

commit ce693ed2acf5f70c6e8d919229be96456bf0ce9e
Author: TALLISON <ta...@apache.org>
AuthorDate: Wed Jul 10 07:21:20 2019 -0400

    TIKA-2903 -- close RereadableStream's storeOutputStream via Peter Fassev
---
 .../src/main/java/org/apache/tika/utils/RereadableInputStream.java  | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java b/tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java
index f352093..b3a528f 100644
--- a/tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java
+++ b/tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java
@@ -219,6 +219,12 @@ public class RereadableInputStream extends InputStream {
      */
     public void close() throws IOException {
         closeStream();
+
+        if (storeOutputStream != null) {
+            storeOutputStream.close();
+            storeOutputStream = null;
+        }
+
         super.close();
         if (storeFile != null) {
             storeFile.delete();