diff --git a/core/src/main/java/de/m3y/mobi/core/MobiHeader.java b/core/src/main/java/de/m3y/mobi/core/MobiHeader.java index ddb5881..5fc5b86 100644 --- a/core/src/main/java/de/m3y/mobi/core/MobiHeader.java +++ b/core/src/main/java/de/m3y/mobi/core/MobiHeader.java @@ -18,14 +18,14 @@ * final MobiHeader header = MobiHeader.read(is); * *

- * For more info about MOBI, see http://wiki.mobileread.com/wiki/MOBI + * For more info about MOBI, see http://wiki.mobileread.com/wiki/MOBI */ public class MobiHeader { /** * Reads MOBI EXTH. *

- * See http://wiki.mobileread.com/wiki/MOBI#EXTH_Header + * See "http://wiki.mobileread.com/wiki/MOBI#EXTH_Header */ public static class Exth { /** @@ -69,8 +69,8 @@ public String toString() { /** * Helper for dealing with EXTH Header types. *

- * See http://wiki.mobileread.com/wiki/MOBI#EXTH_Header - * and https://github.com/dougmassay/kindleunpack-calibre-plugin/blob/master/core_subtree/lib/mobi_header.py + * See http://wiki.mobileread.com/wiki/MOBI#EXTH_Header + * and https://github.com/dougmassay/kindleunpack-calibre-plugin/blob/master/core_subtree/lib/mobi_header.py */ public static class RecordType { public static final int DRM_SERVER_ID = 1; @@ -108,9 +108,9 @@ public static class RecordType { public static final int KF8_COVER_URI = 129; public static final int REGION_MAGNIFICATION = 132; public static final int DICT_SHORT_NAME = 200; - public static final int COVER_OFFSET = 201; // Add to first image field in Mobi Header to find + public static final int COVER_OFFSET = 201; // Add to the first image field in Mobi Header to find // PDB record containing the cover image - public static final int THUMB_OFFSET = 202; // Add to first image field in Mobi Header to find + public static final int THUMB_OFFSET = 202; // Add to the first image field in Mobi Header to find // PDB record containing the thumbnail cover image public static final int HAS_FAKE_COVER = 203; public static final int CREATOR_SOFTWARE_RECORDS = 204; // 204-207 are usually the same for all books @@ -119,7 +119,7 @@ public static class RecordType { public static final int CREATOR_MINOR_VERSION = 206; public static final int CREATOR_BUILD_NUMBER = 207; public static final int WATERMARK = 208; - public static final int TAMPER_PROOF_KEYS = 209; // Used by the Kindle = and Android app) for + public static final int TAMPER_PROOF_KEYS = 209; // Used by the Kindle and Android app for // generating book-specific PIDs. public static final int FONT_SIGNATURE = 300; public static final int CLIPPING_LIMIT = 401; @@ -348,7 +348,7 @@ public static Header read(DataInputStream is, Charset encoding) throws IOExcepti /** * Gets an EXTH records by record type code. * - * @param recordTypeCode the record type code, eg 104 for ISBN. + * @param recordTypeCode the record type code, e.g., 104 for ISBN. * @return the record or null if not available. */ public Record getRecordByTypeCode(int recordTypeCode) { diff --git a/core/src/main/java/de/m3y/mobi/core/PalmDatabase.java b/core/src/main/java/de/m3y/mobi/core/PalmDatabase.java index 3f262f6..a26d651 100644 --- a/core/src/main/java/de/m3y/mobi/core/PalmDatabase.java +++ b/core/src/main/java/de/m3y/mobi/core/PalmDatabase.java @@ -10,7 +10,7 @@ /** * Palm database (PDB) contains one header and zero to many records. *

- * http://wiki.mobileread.com/wiki/PDB + * http://wiki.mobileread.com/wiki/PDB */ public class PalmDatabase { /** @@ -74,9 +74,9 @@ public static class Header { * @param is the input stream. * @return the representing header. * @throws IOException on error. - *

- * See https://wiki.mobileread.com/wiki/PDB#Palm_Database_Format and - * https://wiki.mobileread.com/wiki/MOBI + *

+ * See https://wiki.mobileread.com/wiki/PDB#Palm_Database_Format and + * https://wiki.mobileread.com/wiki/MOBI */ public static Header read(DataInputStream is) throws IOException { Header header = new Header(); diff --git a/pom.xml b/pom.xml index 79baaec..527239a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 libmobi https://github.com/marcelmay/lib-mobi @@ -15,7 +16,7 @@ Apache 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt + https://www.apache.org/licenses/LICENSE-2.0.txt repo @@ -164,7 +165,7 @@ 3.9 - 1.8 + 1.8 diff --git a/standalone/src/main/java/de/m3y/mobi/standalone/Runner.java b/standalone/src/main/java/de/m3y/mobi/standalone/Runner.java index 193d638..c8afb66 100644 --- a/standalone/src/main/java/de/m3y/mobi/standalone/Runner.java +++ b/standalone/src/main/java/de/m3y/mobi/standalone/Runner.java @@ -1,6 +1,8 @@ package de.m3y.mobi.standalone; import java.io.*; +import java.nio.file.Files; +import java.nio.file.Paths; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.json.JsonWriteFeature; @@ -25,7 +27,7 @@ public static void main(String[] args) throws IOException { } try (final DataInputStream is = new DataInputStream(new BufferedInputStream( - new FileInputStream(filename)))) { + Files.newInputStream(Paths.get(filename))))) { ObjectMapper mapper = new ObjectMapper() .enable(SerializationFeature.INDENT_OUTPUT) .enable(SerializationFeature.WRAP_ROOT_VALUE)