切分并设置url参数<br>
分隔符定义在HuluSetting中

@param urlParam url参数
765447
protected static void splitAndSetParams(String urlParam) {
		String[] urlParams = StrUtil.split(urlParam, HuluSetting.urlParamSeparator);
		urlParamsLocal.set(urlParams);
	}
744138
public void onUrlAvailable(String url) {
        if (callback_ != null) {
            callback_.onLinkCreate(url, null);
        }
        updateShareEventToFabric(url);
    }
205818
private void mergeQueryParams(Map<String, String[]> urlParams) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "mergeQueryParams: " + urlParams);
        }
        for (Entry<String, String[]> entry : urlParams.entrySet()) {
            String key = entry.getKey();
            // prepend to postdata values if necessary
            String[] post = this.queryParameters.get(key);
            String[] url = entry.getValue();
            if (null != post) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "map already contains key " + key);
                }
                String[] newVals = new String[post.length + url.length];
                System.arraycopy(url, 0, newVals, 0, url.length);
                System.arraycopy(post, 0, newVals, url.length, post.length);
                this.queryParameters.put(key, newVals);
            } else {
                this.queryParameters.put(key, url);
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "put key " + key + " into map.");
            }
        }
    }
140052
public static Map<String, String> getUrlParams(String param) {
        Map<String, String> map = new HashMap<String, String>();
        if (StringUtils.isEmpty(param)) {
            return map;
        }
        String[] params = param.split("&");
        for (int i = 0; i < params.length; i++) {
            String[] p = params[i].split("=");
            if (p.length == 2) {
                map.put(p[0], p[1]);
            }
        }
        return map;
    }
938606
public void setUrlMapper(QuerySpecUrlMapper urlMapper) {
        checkNotConfiguredYet();
        PreconditionUtil.verify(urlMapper != null, "urlMapper parameter must not be null");
        moduleRegistry.setUrlMapper(urlMapper);
    }
510769
static function addUrlParam($url, $key, $val)
    {
        // Separate the anchor element from the URL if it exists.
        $urlParts = parse_url($url);
        if(isset($urlParts['fragment'])){
            $url = str_replace('#'.$urlParts['fragment'], '', $url);
        }

        $separator = (parse_url($url, PHP_URL_QUERY) == NULL) ? '?' : '&';
        $url .= $separator.$key.'='.$val;

        // Add the anchor back to the URL.
        if(isset($urlParts['fragment'])){
            $url .= '#'.$urlParts['fragment'];
        }

        return $url;
    }
803821
public static Url getPageUrl(final Page page, final PageParameters parameters)
	{
		return getPageUrl(page.getPageClass(), parameters);
	}
779412
@Override
    public void setURL(int parameterIndex, URL x) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        this.parameters[parameterIndex-1] = x == null ? VoltType.NULL_STRING_OR_VARBINARY : x.toString();
    }
929734
public void setGetParams(TreeSet<HtmlParameter> getParams) {
        if (mUri == null) {
            return;
        }

        if (getParams.isEmpty()) {
            try {
                mUri.setQuery("");
        
            } catch (URIException e) {
                log.error(e.getMessage(), e);
            }
            
            return;
        }

        StringBuilder sbQuery = new StringBuilder();
        for (HtmlParameter parameter : getParams) {
            if (parameter.getType() != HtmlParameter.Type.url) {
                continue;
            }

            sbQuery.append(parameter.getName());
            sbQuery.append('=');
            sbQuery.append(parameter.getValue());
            sbQuery.append('&');
        }

        if (sbQuery.length() <= 2) {
            try {
                mUri.setQuery("");
            
            } catch (URIException e) {
                log.error(e.getMessage(), e);
            }
            
            return;
        }

        String query = sbQuery.substring(0, sbQuery.length() - 1);

        try {
            //The previous behaviour was escaping the query,
            //so it is maintained with the use of setQuery.
            mUri.setQuery(query);
            
        } catch (URIException e) {
            log.error(e.getMessage(), e);
        }
    }
298262
public void setUrlParaSeparator(String urlParaSeparator) {
		if (StrKit.isBlank(urlParaSeparator) || urlParaSeparator.contains("/")) {
			throw new IllegalArgumentException("urlParaSepartor can not be blank and can not contains \"/\"");
		}
		this.urlParaSeparator = urlParaSeparator;
	}
266217
public function setUrlKeyParam($urlKeyParam = null)
    {
        if ($urlKeyParam === null) {
            $urlKeyParam = $this->getTokenInputName();
        }

        $this->setData('url_key_param', $urlKeyParam);
        return $this;
    }
674995
public void initParam(ScannerParam param) {        
        // Set targets and RPC selections
        int targets = param.getTargetParamsInjectable();
        this.getChkInjectableQueryString().setSelected((targets & ScannerParam.TARGET_QUERYSTRING) != 0);
        this.getChkAddQueryParam().setSelected(param.isAddQueryParam());
        this.getChkAddQueryParam().setEnabled(getChkInjectableQueryString().isEnabled() && getChkInjectableQueryString().isSelected());
        this.getChkInjectableUrlPath().setSelected((targets & ScannerParam.TARGET_URLPATH) != 0);
        this.getChkInjectablePostData().setSelected((targets & ScannerParam.TARGET_POSTDATA) != 0);
        this.getChkInjectableHeaders().setSelected((targets & ScannerParam.TARGET_HTTPHEADERS) != 0);
        this.getChkInjectableHeadersAllRequests().setSelected(param.isScanHeadersAllRequests());
        this.getChkInjectableHeadersAllRequests().setEnabled(getChkInjectableHeaders().isEnabled() && getChkInjectableHeaders().isSelected());
        this.getChkInjectableCookie().setSelected((targets & ScannerParam.TARGET_COOKIE) != 0);

        int rpcEnabled = param.getTargetParamsEnabledRPC();
        this.getChkRPCMultipart().setSelected((rpcEnabled & ScannerParam.RPC_MULTIPART) != 0);
        this.getChkRPCXML().setSelected((rpcEnabled & ScannerParam.RPC_XML) != 0);
        this.getChkRPCJSON().setSelected((rpcEnabled & ScannerParam.RPC_JSON) != 0);
        this.getChkRPCGWT().setSelected((rpcEnabled & ScannerParam.RPC_GWT) != 0);
        this.getChkRPCoData().setSelected((rpcEnabled & ScannerParam.RPC_ODATA) != 0);
        this.getChkRPCDWR().setSelected((rpcEnabled & ScannerParam.RPC_DWR) != 0);
        this.getChkRPCCustom().setSelected((rpcEnabled & ScannerParam.RPC_CUSTOM) != 0);

        this.getExcludedParameterModel().setTokens(param.getExcludedParamList());
    }
837785
protected void addURL(final URL url) {
    final URL[] newUrls = new URL[this.urls.length + 1];
    System.arraycopy(url, 0, newUrls, 0, this.urls.length);
    newUrls[this.urls.length] = url;
    this.urls = newUrls;
  }
952327
@Override
    public void setURL(String parameterName, URL val) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
1136422
@Override
    @SuppressWarnings("unused")
    public void parseURL(URLStreamHandlerSetter setter, URL url, String arg2, int arg3, int arg4) {

        // ------------------------------------------------------------------------------
        // NOTE: the java.net.URLStreamHandler expects that parseURL will be called
        // for the handler associated with a given URL. This associated handler is
        // actually an OSGi handler proxy. Thus we must tempoorarily alter the URL's
        // handler.
        //
        // See org.eclipse.osgi.framework.internal.protocol.URLStreamHandlerProxy
        // and java.net.URLStreamHandler for details.
        // ------------------------------------------------------------------------------

        URLStreamHandler currentHandler = null;

        try {
            currentHandler = (URLStreamHandler) _handlerField.get(url);
            _handlerField.set(url, getInstance());
            _parseURL.invoke(getInstance(), new Object[] { url, arg2, Integer.valueOf(arg3), Integer.valueOf(arg4) });
        } catch (Exception e) {
            FFDCFilter.processException(e, getClass().getName(), "parseURL", new Object[] { url, this, currentHandler });
        } finally {
            if (currentHandler != null) {
                try {
                    _handlerField.set(url, currentHandler);
                } catch (Exception e) {
                    FFDCFilter.processException(e, getClass().getName(), "parseURL", new Object[] { url, this, currentHandler });
                }
            }
        }
    }
533289
private function _invoke($urlParams) {

        $serviceClassPath = APP_NAME."\\api\\service\\".ucfirst($urlParams[0])."Service";
        try {
            $service = Loader::service($serviceClassPath);
        } catch(\Exception $e) {
            throw new APIException(404, "Can not find the servive '{$serviceClassPath}'.");
        }
        $params = $_GET + $_POST; //获取参数

        //检查当前模块下是否有监听器，如果有则加载监听器
        $lisennerClassName = APP_NAME."\\api\\ModuleListener";
        $listener = null;
        try {
            $reflect = new \ReflectionClass($lisennerClassName);
            $listener = $reflect->newInstance();
        } catch (\ReflectionException $exception) {
            //__print($exception);die();
        }
        // 这里做拦截和权限认证操作
        if ( $listener->needAuthrize("/{$urlParams[0]}/{$urlParams[1]}") ) {
            if ( !$listener->authorize($params) ) {
                throw new APIException(401, "Authorized Faild.");
            }
        }

        try {
            $reflectMethods = new \ReflectionMethod($service, $urlParams[1]);
            $dependParams = array(); //依赖参数
            foreach ($reflectMethods->getParameters() as $value) {
                if (isset($params[$value->getName()])) { // 传入的参数的名称要跟服务方法的参数名相同
                    $dependParams[] = $params[$value->getName()];
                } else if ($value->isDefaultValueAvailable()) {
                    $dependParams[] = $value->getDefaultValue();
                } else {
                    $dependParams[] = null;
                }
            }
            $result = call_user_func_array(array($service, $urlParams[1]), $dependParams);
        } catch (\Exception $e) {
            throw new APIException(500, $e->getMessage());
        }
        $result->output();  //输出json数据
    }
1088998
public static void addParameter(IUrlBuilder urlBuilder, String name, String value) {
        urlBuilder.addParameter(name, value);
    }