File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/main/java/com/fasterxml/jackson/core Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1026,7 +1026,7 @@ public JsonFactory setCodec(ObjectCodec oc) {
1026
1026
public JsonParser createParser (File f ) throws IOException , JsonParseException {
1027
1027
// true, since we create InputStream from File
1028
1028
IOContext ctxt = _createContext (_createContentReference (f ), true );
1029
- InputStream in = new FileInputStream (f );
1029
+ InputStream in = _streamFromFile (f );
1030
1030
return _createParser (_decorate (in , ctxt ), ctxt );
1031
1031
}
1032
1032
Original file line number Diff line number Diff line change @@ -178,8 +178,9 @@ public abstract class TokenStreamFactory
178
178
protected OutputStream _createDataOutputWrapper (DataOutput out ) {
179
179
return new DataOutputAsStream (out );
180
180
}
181
+
181
182
/**
182
- * Helper methods used for constructing an optimal stream for
183
+ * Helper method used for constructing an optimal stream for
183
184
* parsers to use, when input is to be read from an URL.
184
185
* This helps when reading file content via URL.
185
186
*
@@ -210,4 +211,14 @@ protected InputStream _optimizedStreamFromURL(URL url) throws IOException {
210
211
}
211
212
return url .openStream ();
212
213
}
214
+
215
+ /**
216
+ * Helper methods used for constructing an {@link InputStream} for
217
+ * parsers to use, when input is to be read from given {@link File}.
218
+ *
219
+ * @since 2.14
220
+ */
221
+ protected InputStream _streamFromFile (File f ) throws IOException {
222
+ return new FileInputStream (f );
223
+ }
213
224
}
You can’t perform that action at this time.
0 commit comments