java.net.URI.create("http://adserver.adtech.de/adlink|3.0")
throws
java.net.URISyntaxException:
Illegal character in path at index 32: http://adserver.adtech.de/adlink|3.0
although
new java.net.URL("http://adserver.adtech.de/adlink|3.0")
works just fine.
UPDATE 1
although
new org.apache.commons.httpclient.URI("http://adserver.adtech.de/adlink|3.0")
also works perfectly.
What's the reason?
java.net.URLand does not forjava.net.URI?URI.create()andnew URI()throw that exception. In the case ofURI.create()it is wrapped in anIllegalArgumentExceptionas per the Javadoc. Java version 1.7.0_17.URI.createand don't have it withnew URL()