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 2022/09/30 20:57:38 UTC

[tika] branch main updated: TIKA-3867 -- slight improvement -- create the parent directory if it doesn't exist.

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 6e2593c42 TIKA-3867 -- slight improvement -- create the parent directory if it doesn't exist.
6e2593c42 is described below

commit 6e2593c421e108f5a18b97ff9500129383fd59a7
Author: tballison <ta...@apache.org>
AuthorDate: Fri Sep 30 16:57:27 2022 -0400

    TIKA-3867 -- slight improvement -- create the parent directory if it doesn't exist.
---
 .../apache/tika/pipes/reporters/fs/FileSystemStatusReporter.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tika-pipes/tika-pipes-reporters/tika-pipes-reporter-fs-status/src/main/java/org/apache/tika/pipes/reporters/fs/FileSystemStatusReporter.java b/tika-pipes/tika-pipes-reporters/tika-pipes-reporter-fs-status/src/main/java/org/apache/tika/pipes/reporters/fs/FileSystemStatusReporter.java
index 5e6460906..cee42ed36 100644
--- a/tika-pipes/tika-pipes-reporters/tika-pipes-reporter-fs-status/src/main/java/org/apache/tika/pipes/reporters/fs/FileSystemStatusReporter.java
+++ b/tika-pipes/tika-pipes-reporters/tika-pipes-reporter-fs-status/src/main/java/org/apache/tika/pipes/reporters/fs/FileSystemStatusReporter.java
@@ -103,6 +103,13 @@ public class FileSystemStatusReporter extends PipesReporter
         if (statusFile == null) {
             throw new TikaConfigException("must initialize 'statusFile'");
         }
+        if (! Files.isDirectory(statusFile.getParent())) {
+            try {
+                Files.createDirectories(statusFile.getParent());
+            } catch (IOException e) {
+                throw new TikaConfigException("couldn't create directory for status file", e);
+            }
+        }
     }
 
     @Override