Skip to content

refactor FileResource.inputStream to be easier to use#2271

Closed
mkristian wants to merge 1 commit intojruby-1_7from
FileResource.inputStream
Closed

refactor FileResource.inputStream to be easier to use#2271
mkristian wants to merge 1 commit intojruby-1_7from
FileResource.inputStream

Conversation

@mkristian
Copy link
Member

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.

@mkristian mkristian added this to the JRuby 1.7.17 milestone Dec 3, 2014
@mkristian mkristian force-pushed the FileResource.inputStream branch from 18da34f to adb3a85 Compare December 3, 2014 14:02
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()```
@mkristian mkristian force-pushed the FileResource.inputStream branch from adb3a85 to 36e2ed4 Compare December 3, 2014 14:29
Copy link
Contributor

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.

@mkristian
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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants