• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to read files from internet

 
Cody Long
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i post a txt file on the internet is it possible to make a program to read this file?
 
Ulf Dittmer
Rancher
Posts: 42968
73
 
zahid zubair
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I just tried your suggestion, I am getting the following exception after a couple of seconds:



I too want to know about this. Can anyone please help me out to resolve this exception? I am using a proxy server which requires authentication to access the internet. Is it anything to do with this?

Thanks for your help...!
 
Paul Clapham
Sheriff
Posts: 21111
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zahid zubair wrote:I am using a proxy server which requires authentication to access the internet. Is it anything to do with this?


Quite likely yes. Here's a link to Sun's writeup about how to connect via proxy servers. It's possible that just implementing that will automatically deal with the authentication, but it depends on what platform your code is running on and what kind of proxy server it is and so on.
 
zahid zubair
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for your response. I gone through it and was able to accomplish my task using the website given and some google search on java website.



However, I don't understand why the proxyType is set to 4, what does it mean?
 
Joe Ess
Bartender
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zahid zubair wrote:
However, I don't understand why the proxyType is set to 4, what does it mean?


I don't see anything about that system property in the JDK Networking Documentation. Where did you find it?
The java.net.Proxy class is probably easier to deal with than the system properties. Have a look here for an example.
 
zahid zubair
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While I was receiving the HTTP 407 error when I tried the code in the url posted by you, I found the resolution in http://forums.sun.com/thread.jspa?threadID=500360
 
Joe Ess
Bartender
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zahid zubair wrote:While I was receiving the HTTP 407 error when I tried the code in the url posted by you


I'm not Ulf or Paul
I can't find any references to the "http.proxyType" property. The links in that thread don't mention it. The original poster says he got it from another thread, but searching that forum only brings up his post. I think he imagined it.
 
Paul Clapham
Sheriff
Posts: 21111
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Likewise there isn't anything about

in that documentation either.

You'll find that it makes no difference whether you use this system property or not, because it isn't used by any of the JRE code. It's a bogus property, in other words, which somebody thought up years ago and it's been copied from one internet site to another without anybody checking it.
 
zahid zubair
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh. Is it so!!! Thanks for making me aware guys. However, my code copying mistake might have made others aware as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic