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
Hi,
It looks like Oxygen doesn't use default "sun.net.www.protocol.http.HttpURLConnection" for HttpURLConnection. I tried to create a connection using:
It doesn't throws error with this but the same code does work through command-line.
I also tried
But it throws "can not cast" exception.
Is there any way to use default sun.net.www.protocol.http.HttpURLConnection in Oxygen Plugin?
Thanks,
Mandar
It looks like Oxygen doesn't use default "sun.net.www.protocol.http.HttpURLConnection" for HttpURLConnection. I tried to create a connection using:
Code: Select all
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
I also tried
Code: Select all
sun.net.www.protocol.http.HttpURLConnection conn = (sun.net.www.protocol.http.HttpURLConnection) url.openConnection();
Is there any way to use default sun.net.www.protocol.http.HttpURLConnection in Oxygen Plugin?
Thanks,
Mandar
-
- Posts: 9448
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Using default HttpURLConnection
Hi Mandar,
Yes, Oxygen installs and uses its own implementation of java.net.HttpURLConnection 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:
Regards,
Radu
Yes, Oxygen installs and uses its own implementation of java.net.HttpURLConnection 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
sun.net.www.protocol.http.HttpURLConnection conn = new sun.net.www.protocol.http.HttpURLConnection(url, null);
conn.connect();
conn.getInputStream();...
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service