open a URL in the browser that was used to launch SPICE

@param url URL to be opened
@return true if this was successfull
770686
public static boolean showDocument(URL url)
	{
		if ( url != null ){
			boolean success = JNLPProxy.showDocument(url);
			if ( ! success)
				logger.info("could not open URL "+url+" in browser. check your config or browser version.");
		return success;

		}
		else
			return false;
	}
1100731
public static boolean isValidUrl(String url) {
        try {
            if (Strings.isNullOrEmpty(url)) {
                return false;
            }
            new URL(url);
            return true;
        } catch (MalformedURLException e) {
            return false;
        }
    }
377195
public static synchronized boolean canConnect(String url) {
        boolean result = false;
        HttpURLConnection conn = null;
        try {
            conn = getNormalCon(formatUrl(url));
            conn.connect();

            int resultCode = conn.getResponseCode();
            result = (200 == resultCode);

                /*
            if (!result) {
                Log.d("canConnect", resultCode + "|" + url);
            }
            // */

        } catch (IOException e) {
            result = false;
//            Log.e("canConnect", url + "|error:" + e.toString());
        } finally {
            if (conn != null) {
                conn.disconnect();
            }
        }

        return result;
    }
1215240
public URL applyOnURL(URL url) {
        if (url == null) {
            return url;
        }
        try {
            return new URL(applyOnURL(url.toString()));
        } catch (MalformedURLException e) {
            throw new RuntimeException("Cannot applyl query string to: " + url, e);
        }
    }
474010
private boolean isURLAbsolute(String url) {
        for (String protocol : PROTOCOLS) {
            if (url.startsWith(protocol)) {
                return true;
            }
        }

        return false;
    }
77100
public static void browse(String url) {
    Preconditions.checkNotNull(url);
    // Ask user to open in their browser using copy-paste
    System.out.println("Please open the following address in your browser:");
    System.out.println("  " + url);
    // Attempt to open it in the browser
    try {
      if (Desktop.isDesktopSupported()) {
        Desktop desktop = Desktop.getDesktop();
        if (desktop.isSupported(Action.BROWSE)) {
          System.out.println("Attempting to open that address in the default browser now...");
          desktop.browse(URI.create(url));
        }
      }
    } catch (IOException e) {
      LOGGER.log(Level.WARNING, "Unable to open browser", e);
    } catch (InternalError e) {
      // A bug in a JRE can cause Desktop.isDesktopSupported() to throw an
      // InternalError rather than returning false. The error reads,
      // "Can't connect to X11 window server using ':0.0' as the value of the
      // DISPLAY variable." The exact error message may vary slightly.
      LOGGER.log(Level.WARNING, "Unable to open browser", e);
    }
  }
334730
private static HttpURLConnection open(URL url) throws IOException {
        HttpURLConnection c = (HttpURLConnection)url.openConnection();
        c.setReadTimeout(TIMEOUT);
        c.setConnectTimeout(TIMEOUT);
        return c;
    }
1253212
public static Intent newOpenWebBrowserIntent(String url) {
        if (!url.startsWith("https://") && !url.startsWith("http://")) {
            url = "http://" + url;
        }
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        return intent;
    }
1153946
private boolean acceptTargetUrl(String urlS) {
        // Whitelist has precedence. Only patterns on the white list are allowed
        if (whiteList != null) {
            return checkPattern(whiteList, urlS, true);
        }

        // Then blacklist: Everything on this list is forbidden
        if (blackList != null) {
            return checkPattern(blackList, urlS, false);
        }

        // If no list is configured, then everything is allowed
        return true;
    }
870328
private void openBrowser(URI url) throws IOException {
        if (Desktop.isDesktopSupported()) {
            Desktop.getDesktop().browse(url);
        } else {
            LOGGER.error("Can not open browser because this capability is not supported on " +
                    "your platform. You can use the link below to open the report manually.");
        }
    }
1153150
protected String excuteGet(String url, boolean useURI) throws Exception {
		HttpClient httpClient = getHttpClient();
		HttpUriRequest request = getGetRequest(url, useURI);
		
		HttpResponse httpResponse = httpClient.execute(request);

		String response = parseResponse(url, httpResponse);
		return response;
	}
1236572
private void LaunchWebPage(InteractiveObject interactiveObjectFinal, String url) {
        if (webPagePlusUISceneObject == null) {
            final String urlFinal = url;
            final GVRSceneObject gvrSceneObjectAnchor = interactiveObjectFinal.getSensor().getOwnerObject();
            gvrContext.getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {

                    // Launch a new WebView window and place the web page there.
                    gvrWebView = new WebView(gvrContext.getActivity());
                    gvrWebView.setInitialScale(100);
                    gvrWebView.setLayoutParams(new ViewGroup.LayoutParams(1600, 1200));
                    WebSettings webSettings = gvrWebView.getSettings();
                    webSettings.setJavaScriptEnabled(true);


                    if ((urlFinal.endsWith(".xml")) || (urlFinal.endsWith(".rss"))) {
                        if (gvrWebView != null) gvrWebView.loadData(webPageContent, "text/html", null);
                    } // end if rss or xml data
                    else {
                        // Open a Web page
                        gvrWebView.setWebViewClient(new WebViewClient() {
                            //TODO: replace for depricated code with:
                            // onReceivedError (WebView view, WebResourceRequest request, WebResourceError error)
                            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
                                Log.e(TAG, "   setWebViewClient Error ");
                                Log.e(TAG, "   errorCode " + errorCode + "; description " + description + "; url " + failingUrl);
                            }
                        });
                        if (gvrWebView != null) gvrWebView.loadUrl(urlFinal);
                    }  //  end if url data - a web address

                    if (gvrWebView != null) {

                        GVRViewSceneObject gvrWebViewSceneObject = new GVRViewSceneObject(gvrContext,
                                gvrWebView, webViewDimensions[0], webViewDimensions[1]);
                        gvrWebViewSceneObject.setName("Web View");

                        gvrWebViewSceneObject.getRenderData().getMaterial().setOpacity(1.0f);
                        gvrWebViewSceneObject.getTransform().setPosition(0.0f, 0.0f, 0.0f);
                        gvrWebViewSceneObject.getRenderData().setRenderMask(0);
                        gvrWebViewSceneObject.getRenderData().setRenderMask(
                                GVRRenderData.GVRRenderMaskBit.Left
                                        | GVRRenderData.GVRRenderMaskBit.Right);

                        if (useWebPageTranformControls) WebPageTranformControls( gvrWebViewSceneObject, gvrSceneObjectAnchor, urlFinal);
                        else WebPageCloseOnClick( gvrWebViewSceneObject, gvrSceneObjectAnchor, urlFinal);

                    }
                }  // end run
            });
        }  // end if webPagePlusUISceneObject == null
    }
1219425
public String applyOnURL(String url) {
        if (StringUtils.isBlank(url)) {
            return url;
        }
        return StringUtils.substringBefore(url, "?") + toString();
    }
1103150
public static boolean containsURL(final URL[] urls, final URL url) {
        checkNotNull("urls", urls);
        checkNotNull("url", url);
        for (int i = 0; i < urls.length; i++) {
            final URL element = urls[i];
            final String elementStr = element.toExternalForm();
            final String urlStr = url.toExternalForm();
            if (elementStr.equals(urlStr)) {
                return true;
            }
        }
        return false;
    }
1089829
private HttpURLConnection openConnection(URL url) throws IOException {
              HttpURLConnection connection = createConnection(url);
              connection.setUseCaches(true);
              connection.setDoInput(true);
              return connection;
       }
660381
public static Condition url(final String url) {
        return new Condition(input -> input.getUrl().equals(url));
    }
690328
public static SeerClickableLabelAction createBrowseToUrlAction(final String url) {
        return () -> {
            Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
            if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
                try {
                    desktop.browse(URI.create(url));
                }
                catch (IOException | RuntimeException e) {
                    // ignored
                }
            }
        };
    }