mertakdut / EpubParser

Parses .epub files, provides seperation page by page.
Apache License 2.0
118 stars 27 forks source link

please add a constructor for java.io.File #18

Closed epubreader closed 7 years ago

epubreader commented 7 years ago

please change the method setFullContent to support java.io.File, thanks.

Reader reader = new Reader(); reader.setMaxContentPerSection(1000); // Max string length for the current page. reader.setIsIncludingTextContent(true); // Optional, to return the tags-excluded version. reader.setFullContent(new File(epubFilePath)); // Must call before readSection.

mertakdut commented 7 years ago

Sure thing.

But just for the sake of curiosity, why do you need another constructor? Can't you just use the current one with file.getPath()? What would be the difference?

Also epub file is not used as java.io.File but java.util.zip.ZipFile. And java.util.zip.ZipFile is created in setFullContent method, from given path.

The only difference in the additional constructor would be epubFile.getAbsolutePath() instead of path parameter.

mertakdut commented 7 years ago

This still looks redundant to me since I didn't get any explanation.

You could just call file.getAbsolutePath and send the path.