Gets the url contents.

@param urlString the url string
@return the url contents
551553
public static String getUrlContents(String urlString) {
		HttpURLConnection con = null;
		try {
			URL url = new URL(urlString);
			con = (HttpURLConnection) url.openConnection();
			con.connect();
			InputStream inputStream = con.getInputStream();

			BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
			StringBuffer contents = new StringBuffer();
			String line;
			while ((line = reader.readLine()) != null) {
				contents.append(line);
				contents.append(JK.NEW_LINE);
			}
			inputStream.close();
			return contents.toString();
		} catch (Exception e) {
			JKExceptionUtil.handle(e);
			return null;// unreachable
		} finally {
			if (con != null) {
				con.disconnect();
			}
		}
	}
489586
protected String getString() {
		String result = cachedWildcardString;
		if(result == null) {
			synchronized(this) {
				result = cachedWildcardString;
				if(result == null) {
					if(!isMultiple()) {
						result = getDefaultLowerString();
					} else if(!isFullRange() || (result = getDefaultSegmentWildcardString()) == null) {
						result = getDefaultRangeString();
					}
					cachedWildcardString = result;
				}
			}
		}
		return result;
	}
614826
public static String urlFormEncode(final String s)
        {
        if (StringUtils.isBlank(s))
            {
            LOG.warn("Could not encode blank string");
            throw new IllegalArgumentException("Blank string");
            }
        try
            {
            return URLEncoder.encode(s, "UTF-8");
            }
        catch (final UnsupportedEncodingException e)
            {
            LOG.error ("Could not encode: " + s, e);            
            return s;
            }
        }
541392
private JsonObject callGet(final String urlString) {
        return RetryUtils.retry(new Callable<JsonObject>() {
            @Override
            public JsonObject call() {
                return Json
                        .parse(RestClient.create(urlString).withHeader("Authorization", String.format("Bearer %s", apiToken))
                                         .withCaCertificate(caCertificate)
                                         .get())
                        .asObject();
            }
        }, retries, NON_RETRYABLE_KEYWORDS);
    }
1221902
@Override
	public String getString() {
		String result = cachedString;
		if(result == null) {
			synchronized(this) {
				result = cachedString;
				if(result == null) {
					if(isSinglePrefixBlock() || !isMultiple()) { //covers the case of !isMultiple, ie single addresses, when there is no prefix or the prefix is the bit count
						result = getDefaultLowerString();
					} else if(!isFullRange() || (result = getDefaultSegmentWildcardString()) == null) {
						if(isPrefixBlock()) {
							result = getDefaultMaskedRangeString();
						} else {
							result = getDefaultRangeString();
						}
					}
					cachedString = result;
				}
			}
		}
		return result;
	}
1194933
public static Map<URLParts, String> splitURL(String URLString) {
        try {
            return splitURL(new URL(URLString));
        } 
        catch (MalformedURLException ex) {
            throw new RuntimeException(ex);
        }
    }
1294643
public static String getUrlMapping(String url, Map<String, String> urlMappings) {
        if (urlMappings != null) {
            for (String pattern : urlMappings.keySet()) {
                if (urlMatcher.match(pattern, url)) {
                    return urlMappings.get(pattern);
                }
            }
        }
        
        return null;
    }
154854
public static String getValueFromUrl(String url, String preText, int length) {
		String urlContents = getUrlContents(url);
		int indexOf = urlContents.indexOf(preText);
		if (indexOf != -1) {
			indexOf += preText.length();
			String substring = urlContents.substring(indexOf, indexOf + length);
			return substring;
		}
		return null;
	}
933072
static String encodeURLString(String stringToEncode) {
        try {
            return java.net.URLEncoder.encode(stringToEncode, "UTF-8").replace("+", ENCODED_SPACE_CHARACTER);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e); // can't happen
        }
    }
1045609
public static String readString(URL url, String charset) throws IORuntimeException {
		if (url == null) {
			throw new NullPointerException("Empty url provided!");
		}

		InputStream in = null;
		try {
			in = url.openStream();
			return IoUtil.read(in, charset);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		} finally {
			IoUtil.close(in);
		}
	}
420097
public static String asValidHref(String urlString) {
        try {
            return new URL(urlString).toExternalForm();
        } catch (MalformedURLException e) {
            LOG.debug("Malformed url - {}, empty string will be returned", urlString);
            return "";
        }
    }
1314186
function getQueryString(url){
	if(url.indexOf('%')!==-1)  url = decodeURIComponent(url);
	return parse_info(url.substr(url.indexOf('?')+1,url.length-url.indexOf('?')-1));
}
434715
public static String expandUrlString(
            final String urlString,
            final MultiDataContext<ContextView, DataContext> dataContext,
            final String nodename
    )
    {
        final int qindex = urlString.indexOf('?');
        final StringBuilder builder = new StringBuilder();

        builder.append(
                SharedDataContextUtils.replaceDataReferences(
                        qindex > 0 ? urlString.substring(0, qindex) : urlString,
                        dataContext,
                        ContextView.node(nodename),
                        ContextView::nodeStep,
                        urlPathEncoder,
                        true,
                        false
                ));
        if (qindex > 0) {
            builder.append("?");
            if (qindex < urlString.length() - 1) {
                builder.append(SharedDataContextUtils.replaceDataReferences(
                        urlString.substring(qindex + 1),
                        dataContext,
                        ContextView.node(nodename),
                        ContextView::nodeStep,
                        urlQueryEncoder,
                        true,
                        false
                ));
            }

        }

        return builder.toString();
    }
594969
@Override
	public String getString() {
		String result = cachedString;
		if(result == null) {
			synchronized(this) {
				result = cachedString;
				if(result == null) {
					if(isSinglePrefixBlock() || !isMultiple()) { //covers the case of !isMultiple, ie single addresses, when there is no prefix or the prefix is the bit count
						result = getDefaultLowerString();
					} else if(isFullRange()) {
						result = IPAddress.SEGMENT_WILDCARD_STR;
					} else {
						long upperValue = getUpperDivisionValue();
						if(isPrefixBlock()) {
							upperValue &= getDivisionNetworkMask(getDivisionPrefixLength());
						}
						result = getDefaultRangeString(getDivisionValue(), upperValue, getDefaultTextualRadix());
					}
					cachedString = result;
				}
			}
		}
		return result;
	}
452131
public static String get(String urlString, Map<String, Object> paramMap) {
		return HttpRequest.get(urlString).form(paramMap).execute().body();
	}
633924
public static String readStringFromUrlGeneric(String url)
            throws IOException {
        InputStream is = null;
        URL urlObj = null;
        String responseString = PcConstants.NA;
        try {
            urlObj = new URL(url);
            URLConnection con = urlObj.openConnection();

            con.setConnectTimeout(ParallecGlobalConfig.urlConnectionConnectTimeoutMillis);
            con.setReadTimeout(ParallecGlobalConfig.urlConnectionReadTimeoutMillis);
            is = con.getInputStream();

            BufferedReader rd = new BufferedReader(new InputStreamReader(is,
                    Charset.forName("UTF-8")));
            responseString = PcFileNetworkIoUtils.readAll(rd);

        } finally {

            if (is != null) {
                is.close();
            }

        }

        return responseString;
    }
1072926
public static InputStream getUrlInputStream(String urlString) {
		URL url;
		try {
			url = new URL(urlString);
			HttpURLConnection con = (HttpURLConnection) url.openConnection();
			con.connect();
			return con.getInputStream();
		} catch (Exception e) {
			throw new JKException(e);
		}
	}