Author: thomasm
Date: Tue Nov 21 08:28:00 2017
New Revision: 1815883

URL: http://svn.apache.org/viewvc?rev=1815883&view=rev
Log:
OAK-6967 Skip problematic binaries: spurious warning in log file

Modified:
    
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ExtractedTextCache.java

Modified: 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ExtractedTextCache.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ExtractedTextCache.java?rev=1815883&r1=1815882&r2=1815883&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ExtractedTextCache.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ExtractedTextCache.java
 Tue Nov 21 08:28:00 2017
@@ -373,8 +373,11 @@ public class ExtractedTextCache {
         if (indexDir == null || !indexDir.exists()) {
             return;
         }
-        try (FileInputStream in = new FileInputStream(
-                new File(indexDir, TIMEOUT_MAP))) {
+        File file = new File(indexDir, TIMEOUT_MAP);
+        if (!file.exists()) {
+            return;
+        }
+        try (FileInputStream in = new FileInputStream(file)) {
             Properties prop = new Properties();
             prop.load(in);
             for(Entry<Object, Object> e : prop.entrySet()) {
@@ -390,8 +393,8 @@ public class ExtractedTextCache {
         if (indexDir == null || !indexDir.exists()) {
             return;
         }
-        try (FileOutputStream out = new FileOutputStream(
-                    new File(indexDir, TIMEOUT_MAP))) {
+        File file = new File(indexDir, TIMEOUT_MAP);
+        try (FileOutputStream out = new FileOutputStream(file)) {
             Properties prop = new Properties();
             prop.putAll(timeoutMap);
             prop.store(out, "Text extraction timed out for the following 
binaries, and will not be retried");


Reply via email to