Using default HttpURLConnection

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Posts: 3
Joined: Fri Jul 27, 2012 11:16 am

Using default HttpURLConnection

Post by mandar.j » Tue Aug 07, 2012 2:21 pm


It looks like Oxygen doesn't use default "" for HttpURLConnection. I tried to create a connection using:

Code: Select all

HttpURLConnection conn = (HttpURLConnection) url.openConnection();
It doesn't throws error with this but the same code does work through command-line.

I also tried

Code: Select all conn = ( url.openConnection();
But it throws "can not cast" exception.

Is there any way to use default in Oxygen Plugin?


Posts: 7269
Joined: Fri Jul 09, 2004 5:18 pm

Re: Using default HttpURLConnection

Post by Radu » Tue Aug 07, 2012 2:33 pm

Hi Mandar,

Yes, Oxygen installs and uses its own implementation of based on the Apache HTTP Client open source libraries.
So creating an URL based on HTTP and opening a connection by calling its methods will return our custom connection.

In order to use a SUN HTTP connection from a plugin you could have some code like:

Code: Select all conn = new, null);
Radu Coravu
<oXygen/> XML Editor

Post Reply