Skip to content

Commit 0bfe4ba

Browse files
committed
use new FileResource.inputStream method
1 parent 93173f2 commit 0bfe4ba

File tree

1 file changed

+1
-9
lines changed
  • src/main/java/org/jruby/ext/openssl/x509store

1 file changed

+1
-9
lines changed

src/main/java/org/jruby/ext/openssl/x509store/Lookup.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,7 @@ public int loadDefaultJavaCACertsFile() throws Exception {
298298

299299
private InputStream wrapJRubyNormalizedInputStream(String file) throws IOException {
300300
try {
301-
FileResource resource = JRubyFile.createResource(runtime, file);
302-
if ( ! resource.exists() ) {
303-
throw new FileNotFoundException(file + " (No such file or directory)");
304-
}
305-
if ( resource.isDirectory() ) {
306-
throw new IOException(file + " is a directory");
307-
}
308-
InputStream is = resource.openInputStream();
309-
return ( is instanceof BufferedInputStream ) ? is : new BufferedInputStream(is);
301+
return JRubyFile.createResource(runtime, file).inputStream();
310302
}
311303
catch (NoSuchMethodError e) { // JRubyFile.createResource (JRuby < 1.7.13)
312304
File f = new File(file);

0 commit comments

Comments
 (0)