Using org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService behind a proxy [message #648129] |
Tue, 11 January 2011 06:18  |
Eclipse User |
|
|
|
Hi to all,
I want to use org.eclipse.epp.internal.mpc.core.service.DefaultMarketplace Service to get data from marketplaces. If I call it like this:
DefaultMarketplaceService service = new DefaultMarketplaceService(new URL("http://marketplace.eclipse.org"));
List<Market> listMarkets = service.listMarkets(new NullProgressMonitor());
for (Market nextMarekt: listMarkets) {
LOGGER.info("Market " + nextMarekt.getName() + " found");
List<Category> category = nextMarekt.getCategory();
for (Category nextCat: category) {
LOGGER.info("- Category " + nextCat.getName() + "-" + nextCat.getId() + "-" + nextCat.getCount() + " found");
}
}
I get a Connection refused if I'm behind a proxy in our company.
Calling it from home, without any proxy, it works
How can I handle this proxy issue
|
|
|
Re: Using org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService behind a proxy [message #648418 is a reply to message #648129] |
Wed, 12 January 2011 14:42  |
Eclipse User |
|
|
|
Markus,
Proxy settings can be specified in the workspace preferences under
General->Network Connections.
If you're using DefaultMarketplaceService directly it does work outside
of an Eclipse runtime. When running outside of Eclipse, it uses
java.net.URL.openStream() and will work via a proxy by using Java
platform support for proxies. This topic gives a pretty good summary of
how to setup proxies:
http://stackoverflow.com/questions/1432961/how-do-i-make-htt purlconnection-use-a-proxy
You should be aware that DefaultMarketplaceService is an internal class:
it's not API and it's behaviour may change in the future.
David
On 1/11/2011 3:18 AM, Markus Oley wrote:
> Hi to all,
> I want to use
> org.eclipse.epp.internal.mpc.core.service.DefaultMarketplace Service to
> get data from marketplaces. If I call it like this:
> DefaultMarketplaceService service = new DefaultMarketplaceService(new
> URL("http://marketplace.eclipse.org"));
> List<Market> listMarkets = service.listMarkets(new NullProgressMonitor());
> for (Market nextMarekt: listMarkets) {
> LOGGER.info("Market " + nextMarekt.getName() + " found");
> List<Category> category = nextMarekt.getCategory();
> for (Category nextCat: category) {
> LOGGER.info("- Category " + nextCat.getName() + "-" + nextCat.getId() +
> "-" + nextCat.getCount() + " found");
> }
> }
>
> I get a Connection refused if I'm behind a proxy in our company. Calling
> it from home, without any proxy, it works
>
> How can I handle this proxy issue
|
|
|
Powered by
FUDForum. Page generated in 0.03094 seconds