获取js-sdk所需的签名，简化逻辑
不太在意随机数和时间戳的场景，使用更加方便
@param url 当前网页的URL，不包含#及其后面部分
@return 签名以及相关参数
359356
public GetSignatureResponse getSignature(String url) {
        BeanUtil.requireNonNull(url, "请传入当前网页的URL，不包含#及其后面部分");
        //当前时间的秒数
        long timestame = System.currentTimeMillis() / 1000;
        //使用UUID来当随机字符串
        String nonceStr = UUID.randomUUID().toString().replaceAll("-", "");
        return getSignature(nonceStr, timestame, url);
    }
17635
public static String urlToString(URL url) {
        return Checker.isNull(url) ? "" : url.toString().replaceAll("file:" + (Checker.isWindows() ? "/?" : ""), "");
    }
1336820
public static String getPullRequestName(String prUrl) {
        if (notEmpty(prUrl)) {
            int idx = prUrl.lastIndexOf("/");
            if (idx > 0) {
                return " #" + prUrl.substring(idx + 1);
            }
        }
        return "";
    }
573323
public static String getFilename(final URL url) throws UnsupportedEncodingException
	{
		if (isJar(url) || isEar(url))
		{
			String fileName = URLDecoder.decode(url.getFile(), "UTF-8");
			fileName = fileName.substring(5, fileName.indexOf("!"));
			return fileName;
		}
		return URLDecoder.decode(url.getFile(), "UTF-8");
	}
1135296
public static UrlBuilder parse(URL url) {
        final UrlBuilder result = new UrlBuilder();

        if (url != null) {
            final String protocol = url.getProtocol();
            if (protocol != null && !protocol.isEmpty()) {
                result.withScheme(protocol);
            }

            final String host = url.getHost();
            if (host != null && !host.isEmpty()) {
                result.withHost(host);
            }

            final int port = url.getPort();
            if (port != -1) {
                result.withPort(port);
            }

            final String path = url.getPath();
            if (path != null && !path.isEmpty()) {
                result.withPath(path);
            }

            final String query = url.getQuery();
            if (query != null && !query.isEmpty()) {
                result.withQuery(query);
            }
        }

        return result;
    }
293128
public static URL createUrl(String url) {
        try {
            return new URL(url);
        } catch (MalformedURLException e) {
            throw new SdkClientException("Could not create URL: " + url, e);
        }
    }
580516
public static String getUrl(final String url) throws Exception {
        return getUrl(new URL(url), null, null);
    }
788747
public static String convertConsulSerivceId(URL url) {
        if (url == null) {
            return null;
        }
        return convertServiceId(url.getHost(), url.getPort(), url.getPath());
    }
1263797
public String apply(String url) {
    return format(
        getDefault(),
        "%s%s%s=%s",
        url,
        concatenationOperator(url),
        operation,
        argument);
  }
1127203
public static String addParameter(final String url, final String name, final String value) {
        if (url != null) {
            final StringBuilder sb = new StringBuilder();
            sb.append(url);
            if (name != null) {
                if (url.indexOf("?") >= 0) {
                    sb.append("&");
                } else {
                    sb.append("?");
                }
                sb.append(name);
                sb.append("=");
                if (value != null) {
                    sb.append(urlEncode(value));
                }
            }
            return sb.toString();
        }
        return null;
    }
1219425
public String applyOnURL(String url) {
        if (StringUtils.isBlank(url)) {
            return url;
        }
        return StringUtils.substringBefore(url, "?") + toString();
    }
1183540
public static String getTarballResourceNameFromUrl(String url) {
        String resourceName = url.substring(url.lastIndexOf('/') + 1);
        return resourceName;
    }
54442
public static String getDecodedPath(URL url) {
		if (null == url) {
			return null;
		}

		String path = null;
		try {
			// URL对象的getPath方法对于包含中文或空格的问题
			path = URLUtil.toURI(url).getPath();
		} catch (UtilException e) {
			// ignore
		}
		return (null != path) ? path : url.getPath();
	}
1023769
static String getShortName(String url) {
        int lastSlash = url.lastIndexOf('/');
        if (lastSlash < 0) {
            lastSlash = url.lastIndexOf('\\');
        }
        String shortName = url;
        if (lastSlash >= 0 && lastSlash + 1 < url.length()) {
            shortName = url.substring(lastSlash + 1);
        }
        return shortName;
    }
392701
function (url) {
            if (this.$.width) {
                url += ",width=" + ImageService.normalizeImageSize(this.$.width);
            }

            if (this.$.height) {
                url += ",height=" + ImageService.normalizeImageSize(this.$.height);
            }

            return url;
        }
1054866
private String getAssetAsString(String url)
   {
      InputStream is = null;
      try
      {
         is = assetManager.open(url);

         Reader r = new InputStreamReader(is, Charset.forName("UTF-8"));
         char[]         buffer = new char[4096];
         StringBuilder  sb = new StringBuilder();
         int            len = r.read(buffer);
         while (len > 0) {
            sb.append(buffer, 0, len);
            len = r.read(buffer);
         }
         return sb.toString();
      }
      catch (IOException e)
      {
         return null;
      }
      finally {
         try {
            if (is != null)
               is.close();
         } catch (IOException e) {
           // Do nothing
         }
      }
   }
526421
public static String urlToScheme(final String url) {
		for(final String scheme : ALL_SCHEMES) {
			if(url.startsWith(scheme)) {
				return scheme;
			}
		}
		return null;
	}