Package nl.siegmann.epublib.chm
Class ChmParser
java.lang.Object
nl.siegmann.epublib.chm.ChmParser
Reads the files that are extracted from a windows help ('.chm') file and creates a epublib Book out of it.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static org.apache.commons.vfs2.FileObjectfindHhcFileObject(org.apache.commons.vfs2.FileObject chmRootDir) private static ResourcesfindResources(org.apache.commons.vfs2.FileObject rootDir, String inputEncoding) protected static StringfindTitle(org.apache.commons.vfs2.FileObject chmRootDir) Finds in the '#SYSTEM' file the 3rd set of characters that have ascii value >= 32 and >= 126 and is more than 3 characters long.static BookparseChm(org.apache.commons.vfs2.FileObject chmRootDir) static Book
-
Field Details
-
DEFAULT_CHM_HTML_INPUT_ENCODING
- See Also:
-
MINIMAL_SYSTEM_TITLE_LENGTH
public static final int MINIMAL_SYSTEM_TITLE_LENGTH- See Also:
-
-
Constructor Details
-
ChmParser
public ChmParser()
-
-
Method Details
-
parseChm
public static Book parseChm(org.apache.commons.vfs2.FileObject chmRootDir) throws XPathExpressionException, IOException, ParserConfigurationException -
parseChm
public static Book parseChm(org.apache.commons.vfs2.FileObject chmRootDir, String inputHtmlEncoding) throws IOException, ParserConfigurationException, XPathExpressionException -
findTitle
Finds in the '#SYSTEM' file the 3rd set of characters that have ascii value >= 32 and >= 126 and is more than 3 characters long. Assumes that that is then the title of the book.- Parameters:
chmRootDir-- Returns:
- Finds in the '#SYSTEM' file the 3rd set of characters that have ascii value >= 32 and >= 126 and is more than 3 characters long.
- Throws:
IOException
-
findHhcFileObject
private static org.apache.commons.vfs2.FileObject findHhcFileObject(org.apache.commons.vfs2.FileObject chmRootDir) throws org.apache.commons.vfs2.FileSystemException - Throws:
org.apache.commons.vfs2.FileSystemException
-
findResources
private static Resources findResources(org.apache.commons.vfs2.FileObject rootDir, String inputEncoding) throws IOException - Throws:
IOException
-