Hi,
I’m trying to use Java’s (1.6) URLConnection with JRuby and all has gone
well except when I’m trying use the getContent method.
The method signature is “getContent(Class[] classes)” as it needs to
know the class type to convert the response too.
However I try to create the required array of type class (I only need
one element that’s a java string class) it complains and refuses to take
the array I’ve given.
The closest I’ve got is…
class_array = Array.new
class_array << JavaLang::String.class
java_class_array = class_array.to_java JavaLang::String.class
content = connection.get_content java_class_array
Which generates the following error…
unable to convert array to type: Class
I’ve run out of ideas as too how to create the array needed.
Any ideas or help to get around this would be greatly appreciated.
Cheers, Phil