• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Working with Internet URL through Proxy from Java Code

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to execute a java Program which attempts to copy a file from internet URL to my local disk.

I am using the following code for getting connection to the URL.




My system is connected to internet through proxy server. I am using ECLIPSE IDE for executing this Java ProgramIn ECLIPSE I have entered the proxy host, proxy port, proxy authentication details in the Windows --> Preferences --> Internet --> Proxy Settings window.

But when I execute the above Code,it displays an exception java.net.UnknownHostException.

Any ideas on how to connect to Internet URL from a system which is behind the Proxy Server ?
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Saravanan,
This article will help you. You have to set the proxy host in the System.property before calling the URLConnection.

Working with Proxy
 
reply
    Bookmark Topic Watch Topic
  • New Topic