[ji] support converting Ruby File -> Java File#4756
Conversation
|
@kares I have thought about this conversion in the past and was never really sure if this was reasonable or not. Firstly, Ruby File is more than the path but also it's openess (whereas in Java those are different objects) which leads to the second issue is if we ever make a IO.to_java then how will these two methods compare? I am not saying I am against this going in but I have never felt very solid on this behavior. |
|
@enebo have given it thought as well, but either case for the common case it seemed to make still sense. RubyFile has a as for IO -> there's do I make sense? |
|
@kares yeah if to_java can accept the stream types then the no arg being path does make a lot more sense and it will be compatible with IO having the same sort of logic. |
|
exactly + the conversion isn't auto-matic ... compatibility first, users have to request it (or JI has to run into a Java File method signature): |
... with
file.to_java java.io.File