refactor FileResource.inputStream to be easier to use#2271
Closed
refactor FileResource.inputStream to be easier to use#2271
Conversation
18da34f to
adb3a85
Compare
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()```
adb3a85 to
36e2ed4
Compare
Contributor
There was a problem hiding this comment.
I'd keep rationale for closing (implementations allocating native memory) in the new comment.
Member
Author
|
merge manually |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
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.