<..java.io.InputStream getInputStream( url )..>
private java.io.InputStream getInputStream( URL url )
throws java.io.FileNotFoundException,
java.io.IOException {
java.io.InputStream inputStream = null;
String errMssg = "";
try{
connection = null;
connection = url.openConnection();
connection.setRequestProperty("User-Agent",
"["
+ System.getProperty("os.name")
+ " / "
+ System.getProperty("os.arch")
+ "]"
+ "["
+ System.getProperty("java.version")
+ " - "
+ System.getProperty("java.vendor")
+ "]"
);
inputStream = connection.getInputStream();
} catch(java.io.FileNotFoundException ve){
errMssg = "File not found: " + url;
throw new java.io.FileNotFoundException(
"--- Ml2xml input error --- " + errMssg );
} catch (javax.net.ssl.SSLHandshakeException ve){
errMssg = "SSL Handshake Exception: " + ve.getMessage();
throw new javax.net.ssl.SSLHandshakeException(
"--- Ml2xml input error --- " + errMssg );
} catch (java.net.UnknownHostException ve){
errMssg = "Unknown Host Exception: " + ve.getMessage();
throw new java.net.UnknownHostException(
"--- Ml2xml input error --- " + errMssg );
}
return inputStream;
}
-_-_-