URL connection problem
I am trying to connect and read a file using java URL.
url = new URL("my url is does not have any www or .com s");
URLConnection conn = url.openConnection();
InputStream inStr = conn.getInputStream();
This is throwing exception FileNotFoundException: "my url with www and com"
But the given URL is different from the one is showing exception. I mean the www and com is added in the url.
Why this is happenning. The input url is opening in web browser.
I also tried to open the second url i.e with www and com, but giving 404 not found error.
How can i solve this problem...
post the exact URL's... surely you can't expect intelligent answers if you withhold obviously pertinant information.
Whilste we can read minds we try to refrain from doing so whenever possible, as we've discovered that it perturbs the management.
Just another dirty stinking cross poster!
Originally Posted by PhHein
I am not able to post URL in my message, it is giving error.
No problem... just put a space in it after the http:
Originally Posted by rajeshgubba
It is something like, //xyz/abc/123.txt, but it is showing in exception is www . xyz . com , I can not post exact url, it is internal to my cmpny
assume that http: is there at the beginiing..
Well I can almost assure you that it's not a valid URL.
Read the URL API...
I find it terribly confusing myself... poorly written, as in only makes sense to people who already understand it; who aren't the ones reading the document trying to work-out how to use the bluddy thing!