Where were you thinking the exception would be thrown? I'm not seeing any places, sorry. createURLStreamHandler should return null if it doesn't know how to handle the protocol provided, so I believe that's right.