]> source.dussan.org Git - jackcess.git/commitdiff
fix poi detection code for ole handling
authorJames Ahlborn <jtahlborn@yahoo.com>
Sun, 15 Sep 2013 02:53:54 +0000 (02:53 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Sun, 15 Sep 2013 02:53:54 +0000 (02:53 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@802 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/impl/CompoundOleUtil.java
src/main/java/com/healthmarketscience/jackcess/impl/OleUtil.java

index bcf3255ed3e81d0b96c45f5f6fde2b432c2630b1..602db41021eec03a8f55c99e13ee2102ef4e386e 100644 (file)
@@ -55,6 +55,12 @@ public class CompoundOleUtil implements OleUtil.CompoundPackageFactory
   private static final String ENTRY_SEPARATOR = "/";
   private static final String CONTENTS_ENTRY = "CONTENTS";
 
+  static {
+    // force a poi class to be loaded to ensure that when this class is
+    // loaded, we know that the poi classes are available
+    NPOIFSFileSystem.class.getName();
+  }
+
   public CompoundOleUtil() 
   {
   }
index 4471da5ff72118edfee9250f0d53946074cf56e0..4cef25487e0ad6e65109650ea7b0761605a61be3 100644 (file)
@@ -92,7 +92,7 @@ public class OleUtil
       compoundFactory = (CompoundPackageFactory)
         Class.forName("com.healthmarketscience.jackcess.impl.CompoundOleUtil")
         .newInstance();
-    } catch(Exception e) {
+    } catch(Throwable t) {
       // must not have poi, will load compound ole data as "other"
     }
     COMPOUND_FACTORY = compoundFactory;