I want to be able to access custom URLs with apache httpclient. Something like this:
HttpClient client = new HttpClient(); HttpMethod method = new GetMethod('media:///squishy.jpg'); int statusCode = client.executeMethod(method);
Can I somehow register a custom URL handler? Or should I just register one with Java, using
URL.setURLStreamHandlerFactory(...)
Regards.
I don’t think there’s a way to do this in commons httpclient. It doesn’t make a whole lot of sense either, after all it is a HTTP client and ‘media:///squishy.jpg’ is not HTTP, so all the code to implement the HTTP protocol probably couldn’t be used anyways.
could be the way to go, but you’ll probably have to do a lot of protocol coding by hand, depending on your ‘media’-protocol.