refactor FileResource.inputStream to be easier to use #2271
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
for any client code which needs to convert a uri-like path to an inputstream
the way to go is
JRubyFile.create(runtime, path).inputStream()
the motivation for this PR comes from jruby-openssl-0.9.6.dev:
from the user there comes a String with path to a PEM resource. as it turns out this path can be any uri-like path (like from rubygems: https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/rubygems/request.rb#L42).
the following boilerplate code to convert a uri-like path into an input-stream:
jruby/jruby-openssl@aa51d9b#diff-67972a6a9364f41a90295ceabf0e9180R298
is a fix for jruby-1.7.16.1
this PR cleans up the API for such "conversion" and to release jruby-openssl with this clean API it needs a released jruby version with this PR merged.