Bug ID: JDK-4267294 InputStream must be created in getInputStream...
So I have implemented my own class and passed the contentType and InputStream object in the constructor: The folowing is an example to demonstrate the problem.It took me quite a while to find the problem. Maybe some documentation could be added to the javadoc somewhere.