+ /**
+ * Check if the URL is valid and responding.
+ *
+ * @return
+ */
+ private boolean isValidUrl(String server)
+ {
+ // return Jws2Client.validURL(jwsserver); // checks syntax only
+ boolean result = false;
+ if (server != null) {
+ try {
+ URL url = new URL(server);
+ url.openStream().close();
+ result = true;
+ } catch (MalformedURLException e)
+ {
+ System.err.println("Invalid server URL: " + server);
+ result = false;
+ } catch (IOException e)
+ {
+ System.err.println("Error connecting to server: " + server + ": "
+ + e.toString());
+ result = false;
+ }
+ }
+ return result;
+ }
+