根据url生成视频预览
@param url
540866
function createPreviewVideo(url){
        if ( !url )return;

        var conUrl = convert_url(url);

        conUrl = utils.unhtmlForUrl(conUrl);

        $G("preview").innerHTML = '<div class="previewMsg"><span>'+lang.urlError+'</span></div>'+
        '<embed class="previewVideo" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' +
            ' src="' + conUrl + '"' +
            ' width="' + 420  + '"' +
            ' height="' + 280  + '"' +
            ' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >' +
        '</embed>';
    }
609024
@SuppressWarnings("checkstyle:abbreviationaswordinname")
    public URL constructURL() {
        String params = encodeQueryParams();
        String stringUri = url;

        if (params.length() > 0) {
            stringUri += "?" + params;
        }

        try {
            URI uri = new URI(stringUri);
            return uri.toURL();
        } catch (final URISyntaxException e) {
            throw new ApiException("Bad URI: " + stringUri, e);
        } catch (final MalformedURLException e) {
            throw new ApiException("Bad URL: " + stringUri, e);
        }
    }
1162926
private HttpPost preparePost(final String url) {
    final HttpPost httpPost = new HttpPost(this.instanceUrl + url);
    for (final Header header : this.headers) {
      httpPost.addHeader(header);
    }
    return httpPost;
  }
765434
public final static boolean isValidURL(String url) {
        if (url == null) {
            return false;
        } else {
            return Patterns.WEB_URL.matcher(url).matches();
        }
    }
1100731
public static boolean isValidUrl(String url) {
        try {
            if (Strings.isNullOrEmpty(url)) {
                return false;
            }
            new URL(url);
            return true;
        } catch (MalformedURLException e) {
            return false;
        }
    }
843434
public static String doPost(String url, Map<String, String> header, Map<String, String> param)
            throws KeyManagementException, NoSuchAlgorithmException, IOException {

        String result = null;
        HttpClient httpClient = new SSLClient();
        httpClient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, Constant.DEFAULT_CONN_TIMEOUT);
        httpClient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, Constant.DEFAULT_READ_TIMEOUT);
        HttpPost httpPost = new HttpPost(url);
        // 设置Header
        if (header != null) {
            Set<String> keys = header.keySet();
            for (String key : keys) httpPost.setHeader(key, header.get(key));
        }
        //设置参数
        List<NameValuePair> list = new ArrayList<NameValuePair>();
        Iterator iterator = param.entrySet().iterator();
        while (iterator.hasNext()) {
            Entry<String, String> elem = (Entry<String, String>) iterator.next();
            list.add(new BasicNameValuePair(elem.getKey(), elem.getValue()));
        }
        if (list.size() > 0) {
            UrlEncodedFormEntity entity = new UrlEncodedFormEntity(list, Constant.DEFAULT_CHARSET);
            httpPost.setEntity(entity);
        }
        HttpResponse response = httpClient.execute(httpPost);
        if (response != null) {
            HttpEntity resEntity = response.getEntity();
            if (resEntity != null) {
                result = EntityUtils.toString(resEntity, Constant.DEFAULT_CHARSET);
            }
        }
        return result;
    }
821921
private String doPostByUrl(String uri, String param) throws IOException {
        HttpURLConnection connection;
        URL url = new URL(uri);

        connection = (HttpURLConnection)url.openConnection();           // 新建连接实例
        connection.setConnectTimeout(Constant.DEFAULT_CONN_TIMEOUT);    // 设置连接超时时间，单位毫秒
        connection.setReadTimeout(Constant.DEFAULT_READ_TIMEOUT);       // 设置读取数据超时时间，单位毫秒
        connection.setDoInput(true);                                    // 是否打开输出流 true|false
        connection.setDoOutput(true);                                   // 是否打开输入流true|false
        connection.setRequestMethod(Constant.RequestMethodPost);        // 提交方法POST|GET
        connection.setUseCaches(false);                                 // 是否缓存true|false
        connection.connect();                                           // 打开连接端口

         out = new (connection.getOutputStream());
        out.writeBytes(param);
        out.flush();
        out.close();

        BufferedReader reader
                = new BufferedReader(
                        new InputStreamReader(connection.getInputStream(),
                                                Constant.DEFAULT_CHARSET));
        StringBuilder buffer = new StringBuilder();
        String line;
        while ((line = reader.readLine())!= null) {
            buffer.append(line);
        }

        // 关闭连接
        reader.close();
        connection.disconnect();

        return buffer.toString();
    }
1169068
def gen_url(url, text)
      if url =~ /([A-Za-z]+):(.*)/
        type = $1
        path = $2
      else
        type = "http"
        path = url
        url  = "http://#{url}"
      end

      if type == "link"
        if path[0,1] == '#'     # is this meaningful?
          url = path
        else
          url = HTMLGenerator.gen_url(@from_path, path)
        end
      end

      if (type == "http" || type == "link") && 
          url =~ /\.(gif|png|jpg|jpeg|bmp)$/

        "<img src=\"#{url}\" />"
      else
        "<a href=\"#{url}\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
      end
    end
1180807
protected BaseResponse executeGet(String url) {
        BaseResponse response;
        BeanUtil.requireNonNull(url, "url is null");
        //需要传token
        String getUrl = url.replace("#", config.getAccessToken());
        response = NetWorkCenter.get(getUrl);
        return response;
    }
737033
private URL createURL(final String urlString) throws MalformedURLException {

        URL url;
        try {
            url = AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {

                @Override
                public URL run() throws MalformedURLException {
                    return new URL(urlString);
                }
            });
        } catch (PrivilegedActionException e) {
            throw (MalformedURLException) e.getCause();
        }

        return url;
    }
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);
    }
1077152
public void setUrl(String url) {

    Properties p = org.postgresql.Driver.parseURL(url, null);

    if (p == null) {
      throw new IllegalArgumentException("URL invalid " + url);
    }
    for (PGProperty property : PGProperty.values()) {
      if (!this.properties.containsKey(property.getName())) {
        setProperty(property, property.get(p));
      }
    }
  }
744138
public void onUrlAvailable(String url) {
        if (callback_ != null) {
            callback_.onLinkCreate(url, null);
        }
        updateShareEventToFabric(url);
    }
1300612
@Override
    public void addURL(URL url)
    {
        this.finder.addURI(URI.create(url.toExternalForm()));
    }
1148453
public T url(String url) {
        if (view!=null) {
            if (view instanceof WebView) {
                ((WebView)view).loadUrl(url);
            }
            if (view instanceof TextView) {
                ((TextView)view).setAutoLinkMask(Linkify.ALL);
                text(url);
            }
        }
        return self();
    }
1123211
public void setUrl(final String url) {
        final String old = this.url;

        this.url = url;
        this.connectionConfig = System.currentTimeMillis();
        this.connectionValidated = false;

        this.pcs.firePropertyChange("url", old, this.url);
    }
708246
@Override
    public String rewriteUrl(final String url, final String sessionId) {
        if ((url == null) || (sessionId == null))
            return (url);

        String path = url;
        String query = "";
        String anchor = "";
        String fragment = "";
        int question = url.indexOf('?');
        if (question >= 0) {
            path = url.substring(0, question);
            query = url.substring(question);
        }
        int pound = path.indexOf('#');
        if (pound >= 0) {
            anchor = path.substring(pound);
            path = path.substring(0, pound);
        }
        int fragmentIndex = path.lastIndexOf(';');
        if(fragmentIndex >= 0) {
            fragment = path.substring(fragmentIndex);
            path = path.substring(0, fragmentIndex);
        }

        StringBuilder sb = new StringBuilder(path);
        if (sb.length() > 0) { // jsessionid can't be first.
            if(fragmentIndex > 0) {
                if(fragment.contains(name)) {
                    //this does not necessarily mean that this parameter is present. It could be part of the value, or the
                    //name could be a substring of a larger key name
                    sb.append(';'); //we make sure we append the fragment portion
                    String key = null;
                    StringBuilder paramBuilder = new StringBuilder();
                    for (int i = 1; i < fragment.length(); ++i) {
                        char c = fragment.charAt(i);
                        if (key == null) {
                            if (c == '&' || c == '=') {
                                key = paramBuilder.toString();
                                paramBuilder.setLength(0);
                                if (c == '&') {
                                    if (!key.equals(name)) { //we don't append if it matches the name
                                        sb.append(key);
                                        sb.append('&');
                                    }
                                    key = null;
                                }
                            } else {
                                paramBuilder.append(c);
                            }
                        } else {
                            if (c == '&') {
                                String value = paramBuilder.toString();
                                paramBuilder.setLength(0);
                                if (!key.equals(name)) { //we don't append if it matches the name
                                    sb.append(key);
                                    sb.append('=');
                                    sb.append(value);
                                    sb.append('&');
                                }
                                key = null;
                            } else {
                                paramBuilder.append(c);
                            }
                        }
                    }
                    if(paramBuilder.length() > 0) {
                        if(key == null) {
                            key = paramBuilder.toString();
                            if (!key.equals(name)) { //we don't append if it matches the name
                                sb.append(key);
                                sb.append('&');
                            }
                        } else {
                            String value = paramBuilder.toString();
                            if (!key.equals(name)) { //we don't append if it matches the name
                                sb.append(key);
                                sb.append('=');
                                sb.append(value);
                                sb.append('&');
                            }
                        }
                    }
                } else {
                    sb.append(fragment);
                    sb.append("&");
                }
            } else {
                sb.append(';');
            }
            sb.append(name);
            sb.append('=');
            sb.append(sessionId);
        }
        sb.append(anchor);
        sb.append(query);
        UndertowLogger.SESSION_LOGGER.tracef("Rewrote URL from %s to %s", url, sessionId);
        return (sb.toString());
    }