pull/2143/head
kunfei 2 years ago
parent c8b4a9fe30
commit 461664be81
  1. 6
      epublib/src/main/java/me/ag2s/epublib/epub/EpubReader.java
  2. 8
      epublib/src/main/java/me/ag2s/epublib/epub/ResourcesLoader.java

@ -69,8 +69,7 @@ public class EpubReader {
*/ */
public EpubBook readEpubLazy(@NonNull ZipFile zipFile, @NonNull String encoding) public EpubBook readEpubLazy(@NonNull ZipFile zipFile, @NonNull String encoding)
throws IOException { throws IOException {
return readEpubLazy(zipFile, encoding, return readEpubLazy(zipFile, encoding, Arrays.asList(MediaTypes.mediaTypes));
Arrays.asList(MediaTypes.mediaTypes));
} }
public EpubBook readEpub(@NonNull ZipInputStream in, @NonNull String encoding) throws IOException { public EpubBook readEpub(@NonNull ZipInputStream in, @NonNull String encoding) throws IOException {
@ -107,8 +106,7 @@ public class EpubReader {
} }
handleMimeType(result, resources); handleMimeType(result, resources);
String packageResourceHref = getPackageResourceHref(resources); String packageResourceHref = getPackageResourceHref(resources);
Resource packageResource = processPackageResource(packageResourceHref, Resource packageResource = processPackageResource(packageResourceHref, result, resources);
result, resources);
result.setOpfResource(packageResource); result.setOpfResource(packageResource);
Resource ncxResource = processNcxResource(packageResource, result); Resource ncxResource = processNcxResource(packageResource, result);
result.setNcxResource(ncxResource); result.setNcxResource(ncxResource);

@ -46,9 +46,11 @@ public class ResourcesLoader {
* @return Resources * @return Resources
* @throws IOException IOException * @throws IOException IOException
*/ */
public static Resources loadResources(ZipFile zipFile, public static Resources loadResources(
String defaultHtmlEncoding, ZipFile zipFile,
List<MediaType> lazyLoadedTypes) throws IOException { String defaultHtmlEncoding,
List<MediaType> lazyLoadedTypes
) throws IOException {
LazyResourceProvider resourceProvider = LazyResourceProvider resourceProvider =
new EpubResourceProvider(zipFile.getName()); new EpubResourceProvider(zipFile.getName());

Loading…
Cancel
Save