Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[embed-cdt-dev] InputStreamReader from URL fails

I have a weird problem with reading the Keil CMSIS Packs index.

The code is at:

https://github.com/gnu-mcu-eclipse/eclipse-plugins/blob/788176700309d3c71e0ffe80f205ea8f6ae732b5/bundles/ilg.gnumcueclipse.packs.data/src/ilg/gnumcueclipse/packs/cmsis/Index.java#L81

(the strange looking code for the index.idx case is a hack to avoid malformed xmls used in ealy Keil versions; ignore it, the actual case uses the else path).

The problem is with reading from the URL stream.

The code worked perfectly for several years, but recently Keil moved the packs to Azure and added a new redirection. The offending URL is https://www.keil.com/pack/index.pidx

I don't know what is wrong with this redirection, but is not followed.

The strange thing is that I isolated the code in a separate java file, and... it can follow the redirect.


Attachment: Main.java
Description: Binary data


In both cases I configured Eclipse to use Java 1.8, so this should not be caused by an incompatibility.

---

Do you have any idea why the InputStreamReader & co. would behave differently when invoked inside Eclipse compared to a separate program?

My guess is that some defaults are set differently inside Eclipse, but it is just a hunch, I have no evidence; if so, I probably have to explicitly set the connection to follow redirects.

Any suggestions on how to approach this?



Regards,

Liviu


Back to the top