getInpustream on a URL representing the whole jar file leads to java.io.IOException: no entry name specified

Jaikiran Pai jai.forums2013 at gmail.com
Tue Sep 8 13:54:44 UTC 2020


Hello Daniel,

On 08/09/20 6:46 pm, Daniel Fuchs wrote:
> Hi Jaikiran,
>
> I expect it's an incorrect use of the API. AFAICS JarURLConnection
> has always behaved like this.

Thank you for that input.

>
>
> That said, maybe the API should be clarified to make it
> explicit that an exception will be thrown if getInputStream()
> is called on a connection that refers to a jar file (and whose
> entry/entry name is null).

Given that the call indirectly lands in (an internal class)
sun.net.www.protocol.jar.JarURLConnection.getInputStream() from a call
to a very generic/high level java.net.URL.openStream() would that
documentation be public facing (which class?) or just a javadoc on that
internal class' method?

FWIW - the context for this thread is here
https://github.com/quarkusio/quarkus/pull/11970


-Jaikiran





More information about the net-dev mailing list