99import java .util .List ;
1010
1111public class CoreWrapper {
12-
1312 static {
1413 System .loadLibrary ("odr-core" );
1514 }
1615
1716 public static class GlobalParams {
18-
1917 public String coreDataPath ;
2018 public String fontconfigDataPath ;
2119 public String popplerDataPath ;
@@ -33,10 +31,10 @@ public static void initialize(Context context) {
3331
3432 AssetExtractor ae = new AssetExtractor (context .getAssets ());
3533 ae .setOverwrite ();
36- ae .extract (assetsDirectory , "odrcore" );
37- ae .extract (assetsDirectory , "fontconfig" );
38- ae .extract (assetsDirectory , "poppler" );
39- ae .extract (assetsDirectory , "pdf2htmlex" );
34+ ae .extract (assetsDirectory , "core/ odrcore" );
35+ ae .extract (assetsDirectory , "core/ fontconfig" );
36+ ae .extract (assetsDirectory , "core/ poppler" );
37+ ae .extract (assetsDirectory , "core/ pdf2htmlex" );
4038
4139 CoreWrapper .GlobalParams globalParams = new CoreWrapper .GlobalParams ();
4240 globalParams .coreDataPath = odrCoreDataDirectory .getAbsolutePath ();
@@ -47,7 +45,6 @@ public static void initialize(Context context) {
4745 }
4846
4947 public static class CoreOptions {
50-
5148 public boolean ooxml ;
5249 public boolean txt ;
5350 public boolean pdf ;
@@ -68,27 +65,21 @@ public static CoreResult parse(CoreOptions options) {
6865 switch (result .errorCode ) {
6966 case 0 :
7067 break ;
71-
7268 case -1 :
7369 result .exception = new CoreCouldNotOpenException ();
7470 break ;
75-
7671 case -2 :
7772 result .exception = new CoreEncryptedException ();
7873 break ;
79-
8074 case -3 :
8175 result .exception = new CoreUnknownErrorException ();
8276 break ;
83-
8477 case -4 :
8578 result .exception = new CoreCouldNotTranslateException ();
8679 break ;
87-
8880 case -5 :
8981 result .exception = new CoreUnexpectedFormatException ();
9082 break ;
91-
9283 default :
9384 result .exception = new CoreUnexpectedErrorCodeException ();
9485 }
@@ -140,7 +131,6 @@ public static void close() {
140131 public static native void stopServer ();
141132
142133 public static class CoreResult {
143-
144134 public int errorCode ;
145135
146136 public Exception exception ;
@@ -168,5 +158,4 @@ public static class CoreUnknownErrorException extends RuntimeException {}
168158 public static class CoreCouldNotEditException extends RuntimeException {}
169159
170160 public static class CoreCouldNotSaveException extends RuntimeException {}
171-
172161}
0 commit comments