V
VUNETdotUS
Hi,
I am trying to get a content of a file located on some server with the
code below. Some web pages send the content fine but the one I need
does not (it contains https in URL), resulting in error which follows
the code:
try {
URL url = new URL ( "http://www.MYWEBSITE.com" ) ;
URLConnection urlConnection = url.openConnection ( ) ;
BufferedReader htmlPage = new BufferedReader ( new
InputStreamReader ( url.openStream ( ) ) ) ;
String line = "";
while ( ( line = htmlPage.readLine ( ) ) != null ) {
//do something with the html line
}
htmlPage.close ( ) ;
urlConnection = null;
} catch ( Exception e ) {
e.printStackTrace ( ) ;
}
ERROR:
java.net.CoonectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(NativeMethod)
at...
What do I miss?
Thanks.
I am trying to get a content of a file located on some server with the
code below. Some web pages send the content fine but the one I need
does not (it contains https in URL), resulting in error which follows
the code:
try {
URL url = new URL ( "http://www.MYWEBSITE.com" ) ;
URLConnection urlConnection = url.openConnection ( ) ;
BufferedReader htmlPage = new BufferedReader ( new
InputStreamReader ( url.openStream ( ) ) ) ;
String line = "";
while ( ( line = htmlPage.readLine ( ) ) != null ) {
//do something with the html line
}
htmlPage.close ( ) ;
urlConnection = null;
} catch ( Exception e ) {
e.printStackTrace ( ) ;
}
ERROR:
java.net.CoonectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(NativeMethod)
at...
What do I miss?
Thanks.