Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor FileResource.inputStream to be easier to use #2271

wants to merge 1 commit into from


Copy link

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

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:

the following boilerplate code to convert a uri-like path into an input-stream:
is a fix for jruby-

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.

@mkristian mkristian added this to the JRuby 1.7.17 milestone Dec 3, 2014
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()```
* opens input-stream to the underlying resource. this is place where
* the input-stream gets opened. users of this method should follow the pattern:
* close the stream where you open it.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep rationale for closing (implementations allocating native memory) in the new comment.

Copy link
Member Author

merge manually

@mkristian mkristian closed this Dec 5, 2014
@mkristian mkristian deleted the FileResource.inputStream branch December 6, 2014 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants