@@ -108,31 +108,48 @@ public static Connection newSession() {
108108 /**
109109 Parse the contents of a file as HTML.
110110
111- @param in file to load HTML from
111+ @param file file to load HTML from. Supports gzipped files (ending in .z or .gz).
112112 @param charsetName (optional) character set of file contents. Set to {@code null} to determine from {@code http-equiv} meta tag, if
113113 present, or fall back to {@code UTF-8} (which is often safe to do).
114114 @param baseUri The URL where the HTML was retrieved from, to resolve relative links against.
115115 @return sane HTML
116116
117117 @throws IOException if the file could not be found, or read, or if the charsetName is invalid.
118118 */
119- public static Document parse (File in , @ Nullable String charsetName , String baseUri ) throws IOException {
120- return DataUtil .load (in , charsetName , baseUri );
119+ public static Document parse (File file , @ Nullable String charsetName , String baseUri ) throws IOException {
120+ return DataUtil .load (file , charsetName , baseUri );
121121 }
122122
123123 /**
124124 Parse the contents of a file as HTML. The location of the file is used as the base URI to qualify relative URLs.
125125
126- @param in file to load HTML from
126+ @param file file to load HTML from. Supports gzipped files (ending in .z or .gz).
127127 @param charsetName (optional) character set of file contents. Set to {@code null} to determine from {@code http-equiv} meta tag, if
128128 present, or fall back to {@code UTF-8} (which is often safe to do).
129129 @return sane HTML
130130
131131 @throws IOException if the file could not be found, or read, or if the charsetName is invalid.
132132 @see #parse(File, String, String)
133133 */
134- public static Document parse (File in , @ Nullable String charsetName ) throws IOException {
135- return DataUtil .load (in , charsetName , in .getAbsolutePath ());
134+ public static Document parse (File file , @ Nullable String charsetName ) throws IOException {
135+ return DataUtil .load (file , charsetName , file .getAbsolutePath ());
136+ }
137+
138+ /**
139+ Parse the contents of a file as HTML.
140+
141+ @param file file to load HTML from. Supports gzipped files (ending in .z or .gz).
142+ @param charsetName (optional) character set of file contents. Set to {@code null} to determine from {@code http-equiv} meta tag, if
143+ present, or fall back to {@code UTF-8} (which is often safe to do).
144+ @param baseUri The URL where the HTML was retrieved from, to resolve relative links against.
145+ @param parser alternate {@link Parser#xmlParser() parser} to use.
146+ @return sane HTML
147+
148+ @throws IOException if the file could not be found, or read, or if the charsetName is invalid.
149+ @since 1.14.2
150+ */
151+ public static Document parse (File file , @ Nullable String charsetName , String baseUri , Parser parser ) throws IOException {
152+ return DataUtil .load (file , charsetName , baseUri , parser );
136153 }
137154
138155 /**
0 commit comments