当前位置: 首页>>代码示例>>Java>>正文


Java URL类代码示例

本文整理汇总了Java中com.google.gwt.http.client.URL的典型用法代码示例。如果您正苦于以下问题:Java URL类的具体用法?Java URL怎么用?Java URL使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


URL类属于com.google.gwt.http.client包,在下文中一共展示了URL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: authenticate

import com.google.gwt.http.client.URL; //导入依赖的package包/类
public void authenticate() {
	if (!CONSTANTS.allowUserLogin()) {
		if (isAllowLookup())
			doLookup();
		else
			ToolBox.open(GWT.getHostPageBaseURL() + "login.do?target=" + URL.encodeQueryString(Window.Location.getHref()));
		return;
	}
	AriaStatus.getInstance().setText(ARIA.authenticationDialogOpened());
	iError.setVisible(false);
	iDialog.center();
	Scheduler.get().scheduleDeferred(new ScheduledCommand() {
		@Override
		public void execute() {
			iUserName.selectAll();
			iUserName.setFocus(true);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:UserAuthentication.java

示例2: createUrlToShare

import com.google.gwt.http.client.URL; //导入依赖的package包/类
private SelectHandler createUrlToShare(final VerticalPanel geoDataContainer) {
	return new SelectHandler() {
		@Override
		public void onSelect(SelectEvent event) {
			urlToShareAnchor.setHref(getHref());
			urlToShareAnchor.setText(
					UIMessages.INSTANCE.seeOtherWindow("GeoWE Project"),
					Direction.LTR);

			urlShared.setText(getHref());
			urlPanel.setVisible(true);
			urlShared.setVisible(true);
		}

		private String getHref() {
			String baseUrl = GWT.getHostPageBaseURL();

			baseUrl += "?projectUrl="
					+ URL.encodeQueryString(urlTextField.getValue());

			return baseUrl;
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:25,代码来源:OpenProjectDialog.java

示例3: createWfsUrl

import com.google.gwt.http.client.URL; //导入依赖的package包/类
private String createWfsUrl() {
	StringBuffer url = new StringBuffer(serviceUrl);
	url.append("?request=GetFeature");
	url.append("&service=WFS");
	url.append("&version=" + version);
	url.append("&typeName=" + nameSpaceFeatureType);
	if (maxFeatures != 0) {
		url.append(getMaxFeaturesLimit());
	}
	if (!getFormat().isEmpty()) {
		url.append(getOutputFormat());
	}
	if (queryBbox) {
		url.append("&srsName=" + getEpsg());
		url.append("&bbox=" + bbox.getLowerLeftX() + ","
				+ bbox.getLowerLeftY() + "," + bbox.getUpperRightX() + ","
				+ bbox.getUpperRightY());
	} else {
		url.append("&CQL_FILTER=" + URL.encodeQueryString(cql));
	}
	return url.toString();
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:23,代码来源:WfsVectorLayerDef.java

示例4: buildCompleteJsonUrl

import com.google.gwt.http.client.URL; //导入依赖的package包/类
private static String buildCompleteJsonUrl(String controllerUrl, String[] params, EnumControllerCommand command) {
	String url = controllerUrl;
	int paramCounter = 0;
	url = url.endsWith("/") ? url : url + "/";
	String methodUrl = getJsonMethodUrl(command);
	
	if (methodUrl.equals("")) {
		return "";
	} else {
		url += methodUrl;
	}		
	
	for (String param : params) {
		url += param;
		paramCounter++;
		if (paramCounter < params.length) {
			url = url.endsWith("/") ? url : url + "/";
		}
	}
	url = URL.encode(url);
	return url;
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:23,代码来源:JSONPControllerConnector.java

示例5: buildCompleteJsonUrl

import com.google.gwt.http.client.URL; //导入依赖的package包/类
private static String buildCompleteJsonUrl(String controllerUrl, String[] params, EnumControllerCommand command) {
	String url = controllerUrl;
	int paramCounter = 0;
	url = url.endsWith("/") ? url : url + "/";
	String methodUrl = getJsonMethodUrl(command);
	
	if (methodUrl.equals("")) {
		return "";
	} else {
		url += methodUrl;
	}		
	
	for (String param : params) {
		url += param;
		paramCounter++;
		if (paramCounter < params.length) {
			url = url.endsWith("/") ? url : url + "/";
		}
	}
	
	url = URL.encode(url);
	return url;
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:24,代码来源:JSONControllerConnector.java

示例6: init

import com.google.gwt.http.client.URL; //导入依赖的package包/类
public void init(LASRequest request, String cruiseid) {
  	message.setVisible(false);
  	request.setOperation("Cruise_List", "v7");
  	List<Map<String, String>> c = request.getVariableConstraints();
  	for (Iterator cIt = c.iterator(); cIt.hasNext();) {
	Map<String, String> map = (Map<String, String>) cIt.next();
	String varid = map.get("varID");
	if ( varid.equals(cruiseid)) {
		
	} else {
		
	}
}
String url = Util.getProductServer()+"?xml="+URL.encode(request.toString());
  	RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, UriUtils.sanitizeUri(url));
try {
	sendRequest.sendRequest(null, iconListRequestCallback);
} catch (RequestException e) {
	message.setVisible(true);
	message.setHTML("Unable to icon list");
}
  }
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:23,代码来源:CruiseIconWidget.java

示例7: onClick

import com.google.gwt.http.client.URL; //导入依赖的package包/类
@Override
public void onClick(ClickEvent event) {
	if ( xSecondID.equals(xInitialId) ) {
		Window.alert("Please select a second data set.");
	} else if ( xSecondVarID.equals(xInitialId) ) {
		Window.alert("Second variable not set, try again in a moment.");
	} else {
		set.clear();
		lasRequest = new LASRequest();
		lasRequest.setOperation("Climate_Analysis_Plot", "V7");
		lasRequest.addVariable(xFirstID, xFirstVarID, 0);
		lasRequest.addVariable(xSecondID, xSecondVarID, 0);
		lasRequest.setRange("t", xDateWidget.getFerretDateLo(), xDateWidget.getFerretDateHi(), 0);
		lasRequest.setRange("t", xDateWidgetTwo.getFerretDateLo(), xDateWidgetTwo.getFerretDateHi(), 1);
		String type = xAnalysisType.getValue(xAnalysisType.getSelectedIndex());
		lasRequest.setProperty("climate_analysis", "type", type);
		List<String> activeRegions = xRegions.getActiveVariablesAndRegions();
		for (Iterator arIt = activeRegions.iterator(); arIt.hasNext();) {
			String ar = (String) arIt.next();
			lasRequest.setProperty("climate_analysis_regions", type+"_region_"+ar, ar);
		}
		Window.open(Util.getProductServer()+"?xml="+URL.encode(lasRequest.toString()), "_blank", Constants.WINDOW_FEATURES);
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:25,代码来源:ClimateAnalysis.java

示例8: getTokenMap

import com.google.gwt.http.client.URL; //导入依赖的package包/类
public static HashMap<String, String> getTokenMap(String token) {
    token = URL.decode(token);
	String[] tokens = token.split(";");
	HashMap<String, String> tokenMap = new HashMap<String, String>();
	for( int i=0; i < tokens.length; i++ ) {
		if ( tokens[i].contains("=") ) {
			String[] parts = tokens[i].split("=");
			String name = parts[0];
			String value = parts[1];
			if ( !value.contains("ferret_") ) {
				tokenMap.put(name, value);
			}
		}
	}
	return tokenMap;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:17,代码来源:Util.java

示例9: TokenParser

import com.google.gwt.http.client.URL; //导入依赖的package包/类
public TokenParser(String token) {
	
	String[] tokens = token.split("\\" + TokenConstants.FilterMainSeparator, 2);
	
	primaryToken = URL.decode(tokens[0]);
	
	if (tokens.length > 1) {
		filters = new HashMap<String, String>();
		String[] filterComponents = tokens[1].split("\\" + TokenConstants.FilterSeparator, 0);
		for (String filter : filterComponents) {
			String[] keyValue = filter.split("\\" + TokenConstants.FilterKeyValueSeparator, 2);
			if (keyValue.length != 2)
				continue;
			filters.put(URL.decode(keyValue[0]), URL.decode(keyValue[1]));
		}
	} else {
		filters = null;
	}
	
}
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:21,代码来源:TokenParser.java

示例10: addDocumentToWikiEditor

import com.google.gwt.http.client.URL; //导入依赖的package包/类
/**
 * addDocument
 */
private void addDocumentToWikiEditor() {
	if (selectedRow >= 0) {
		String uuid = documentTable.getText(selectedRow, 2);
		String name = UtilComunicator.getName(documentTable.getText(selectedRow, 1));

		switch (type) {
			case FIND_DOCUMENT:
				Wiki.get().addDocumentTag(uuid, name);
				break;

			case FIND_IMAGE:
				String url = RPCService.DownloadServlet;
				url += "?uuid=" + URL.encodeQueryString(uuid);
				Wiki.get().addImageTag(url, getParameters());
				break;
		}
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:22,代码来源:FindDocumentSelectPopup.java

示例11: addDocumentToHTMLEditor

import com.google.gwt.http.client.URL; //导入依赖的package包/类
/**
 * addDocument
 */
private void addDocumentToHTMLEditor() {
	if (selectedRow >= 0) {
		String uuid = documentTable.getText(selectedRow, 2);
		String name = UtilComunicator.getName(documentTable.getText(selectedRow, 1));

		switch (type) {
			case FIND_DOCUMENT:
				addDocumentHTMLEditor(uuid, name);
				break;

			case FIND_IMAGE:
				String downloadServletName = RPCService.DownloadServlet.substring(RPCService.DownloadServlet.lastIndexOf("/") + 1);
				String url = "./" + downloadServletName;
				url += "?uuid=" + URL.encodeQueryString(uuid);
				addImageHTMLEditor(url, getParameters());
				break;
		}
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:23,代码来源:FindDocumentSelectPopup.java

示例12: downloadFiles

import com.google.gwt.http.client.URL; //导入依赖的package包/类
/**
 * Download files exported as zip
 *
 * @author danilo
 */
@Deprecated
public static void downloadFiles(List<String> path, String params) {
	if (!params.equals("")) {
		params = "&" + params;
	}

	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.DownloadServlet + "?export" + params;

	for (String p : path) {
		url += "&pathList=" + URL.encodeQueryString(p);
	}

	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:21,代码来源:Util.java

示例13: setQueryString

import com.google.gwt.http.client.URL; //导入依赖的package包/类
protected void setQueryString(String queryString) {
	this.queryString = queryString;
	paramMap = new HashMap<String, String>();

	if (queryString != null && queryString.length() > 1) {
		String qs = queryString.substring(1);
		String[] kvPairs = qs.split("&");
		for (int i = 0; i < kvPairs.length; i++) {
			String[] kv = kvPairs[i].split("=");
			if (kv.length > 1) {
				paramMap.put(kv[0], URL.decodeQueryString(kv[1]));
			} else {
				paramMap.put(kv[0], "");
			}
		}
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:18,代码来源:Location.java

示例14: showEmbedPDF

import com.google.gwt.http.client.URL; //导入依赖的package包/类
/**
 * showEmbedPDF
 *
 * @param uuid Unique document ID to be previewed.
 */
public void showEmbedPDF(String uuid) {
	hideWidgetExtension();
	vPanel.clear();

	if (previewEvent != null) {
		vPanel.add(hReturnPanel);
		vPanel.setCellHeight(hReturnPanel, String.valueOf(TURN_BACK_HEIGHT) + "px");
	}

	vPanel.add(pdf);
	vPanel.setCellHorizontalAlignment(pdf, HasAlignment.ALIGN_CENTER);
	vPanel.setCellVerticalAlignment(pdf, HasAlignment.ALIGN_MIDDLE);

	if (previewAvailable) {
		String url = RPCService.DownloadServlet + "?inline=true&uuid=" + URL.encodeQueryString(uuid);
		pdf.setHTML("<div id=\"pdfembededcontainer\">" +
				"<object id=\"" + pdfID + "\" name=\"" + pdfID + "\" width=\"" + width + "\" height=\"" + height + "\" type=\"application/pdf\" data=\"" + url + "\"&#zoom=85&scrollbar=1&toolbar=1&navpanes=1&view=FitH\">" +
				"<p>Browser plugin suppport error, PDF can not be displayed</p>" +
				"</object>" +
				"</div>\n"); // needed for rewriting  purpose
	} else {
		swf.setHTML("<div id=\"pdfembededcontainer\" align=\"center\"><br><br>" + Main.i18n("preview.unavailable") + "</div>\n");
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:30,代码来源:Preview.java

示例15: getUrl

import com.google.gwt.http.client.URL; //导入依赖的package包/类
/**
 * Constructs a url for searching tweets
 *
 * the url has the form:
 *
 *  HOST_URL/search/:text/:screenName/:collection/:fromYear/:fromMonth/:fromDay/:toYear/:toMonth/:toDay/:page
 *
 * @param e
 * @return
 */
private static String getUrl(SearchEvent e){

    searchText = e.getSearchText();

    searchText = URL.encodePathSegment(searchText);

    url = Consts.HOST_URL + "/search/" + searchText + "/";

    url = url + e.getAccount() + "/" + ((e.getSearchType() == 2) ? "mentions" : "statuses");

    url = url + "/" + e.getMediaOnly();

    if (e.getStartDate() != null && e.getEndDate() != null){
        url = url + e.getStartDate() + e.getEndDate() + "/";
    }else if (e.getEndDate() != null){
        url = url + "/0/0/0" + e.getEndDate() + "/";
    }else if (e.getStartDate() != null){
        url = url + e.getStartDate() + "/0/0/0/";
    }else{
        url = url + "/0/0/0/0/0/0/";
    }

    return url;
}
 
开发者ID:WSDOT,项目名称:social-analytics,代码行数:35,代码来源:SearchView.java


注:本文中的com.google.gwt.http.client.URL类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。