jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r408896 - in /jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query: MsExcelTextFilter.java MsPowerPointTextFilter.java MsWordTextFilter.java PdfTextFilter.java
Date Tue, 23 May 2006 14:03:14 GMT
Author: mreutegg
Date: Tue May 23 07:03:14 2006
New Revision: 408896

URL: http://svn.apache.org/viewvc?rev=408896&view=rev
Log:
JCR-438: Improve handling for missing text filter dependency

Modified:
    jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsExcelTextFilter.java
    jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsPowerPointTextFilter.java
    jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsWordTextFilter.java
    jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/PdfTextFilter.java

Modified: jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsExcelTextFilter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsExcelTextFilter.java?rev=408896&r1=408895&r2=408896&view=diff
==============================================================================
--- jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsExcelTextFilter.java
(original)
+++ jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsExcelTextFilter.java
Tue May 23 07:03:14 2006
@@ -43,6 +43,13 @@
 public class MsExcelTextFilter implements TextFilter {
 
     /**
+     * Force loading of dependent class.
+     */
+    static {
+        POIFSFileSystem.class.getName();
+    }
+
+    /**
      * @return <code>true</code> for <code>application/vnd.ms-excel</code>,
<code>false</code> otherwise.
      */
     public boolean canFilter(String mimeType) {

Modified: jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsPowerPointTextFilter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsPowerPointTextFilter.java?rev=408896&r1=408895&r2=408896&view=diff
==============================================================================
--- jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsPowerPointTextFilter.java
(original)
+++ jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsPowerPointTextFilter.java
Tue May 23 07:03:14 2006
@@ -42,6 +42,13 @@
  */
 public class MsPowerPointTextFilter implements TextFilter {
 
+    /**
+     * Force loading of dependent class.
+     */
+    static {
+        POIFSReader.class.getName();
+    }
+
 	/**
 	 * Reader
 	 */

Modified: jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsWordTextFilter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsWordTextFilter.java?rev=408896&r1=408895&r2=408896&view=diff
==============================================================================
--- jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsWordTextFilter.java
(original)
+++ jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/MsWordTextFilter.java
Tue May 23 07:03:14 2006
@@ -37,6 +37,13 @@
 public class MsWordTextFilter implements TextFilter {
 
     /**
+     * Force loading of dependent class.
+     */
+    static {
+        WordExtractor.class.getName();
+    }
+
+    /**
      * @return <code>true</code> for <code>application/vnd.ms-word</code>

      * or <code>application/msword</code>, <code>false</code> otherwise.
      */

Modified: jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/PdfTextFilter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/PdfTextFilter.java?rev=408896&r1=408895&r2=408896&view=diff
==============================================================================
--- jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/PdfTextFilter.java
(original)
+++ jackrabbit/trunk/textfilters/src/java/org/apache/jackrabbit/core/query/PdfTextFilter.java
Tue May 23 07:03:14 2006
@@ -41,6 +41,13 @@
 public class PdfTextFilter implements TextFilter {
 
     /**
+     * Force loading of dependent class.
+     */
+    static {
+        PDFParser.class.getName();
+    }
+
+    /**
      * @return <code>true</code> for <code>application/pdf</code>,
<code>false</code> otherwise.
      */
     public boolean canFilter(String mimeType) {
@@ -85,6 +92,10 @@
                         } finally {
                             document.close();
                         }
+                    } catch (Exception e) {
+                        // it may happen that PDFParser throws a runtime
+                        // exception when parsing certain pdf documents
+                        throw new IOException(e.getMessage());
                     } finally {
                         in.close();
                     }



Mime
View raw message