當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpMethod.GET屬性代碼示例

本文整理匯總了Java中javax.ws.rs.HttpMethod.GET屬性的典型用法代碼示例。如果您正苦於以下問題:Java HttpMethod.GET屬性的具體用法?Java HttpMethod.GET怎麽用?Java HttpMethod.GET使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.ws.rs.HttpMethod的用法示例。


在下文中一共展示了HttpMethod.GET屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: validateSpaceInternal

/**
 * Validate the space configuration and return the corresponding details.
 */
protected CurlRequest[] validateSpaceInternal(final Map<String, String> parameters, final String... partialRequests) {
	final String url = StringUtils.removeEnd(parameters.get(PARAMETER_URL), "/");
	final String space = ObjectUtils.defaultIfNull(parameters.get(PARAMETER_SPACE), "0");
	final CurlRequest[] result = new CurlRequest[partialRequests.length];
	for (int i = 0; i < partialRequests.length; i++) {
		result[i] = new CurlRequest(HttpMethod.GET, url + partialRequests[i] + space, null);
		result[i].setSaveResponse(true);
	}

	// Prepare the sequence of HTTP requests to Confluence
	final ConfluenceCurlProcessor processor = new ConfluenceCurlProcessor();
	authenticate(parameters, processor);

	// Execute the requests
	processor.process(result);

	// Get the space if it exists
	if (result[0].getResponse() == null) {
		// Invalid couple PKEY and id
		throw new ValidationJsonException(PARAMETER_SPACE, "confluence-space", parameters.get(PARAMETER_SPACE));
	}
	return result;
}
 
開發者ID:ligoj,項目名稱:plugin-km-confluence,代碼行數:26,代碼來源:ConfluencePluginResource.java

示例2: findAllByName

/**
 * Find the repositories matching to the given criteria.Look into name only.
 * 
 * @param criteria
 *            the search criteria.
 * @param node
 *            the node to be tested with given parameters.
 * @return project name.
 */
@GET
@Path("{node}/{criteria}")
@Consumes(MediaType.APPLICATION_JSON)
public List<NamedBean<String>> findAllByName(@PathParam("node") final String node, @PathParam("criteria") final String criteria) {
	final Map<String, String> parameters = pvResource.getNodeParameters(node);
	final CurlRequest request = new CurlRequest(HttpMethod.GET, StringUtils.appendIfMissing(parameters.get(parameterUrl), "/"), null);
	request.setSaveResponse(true);
	newCurlProcessor(parameters).process(request);

	// Prepare the context, an ordered set of projects
	final Format format = new NormalizeFormat();
	final String formatCriteria = format.format(criteria);

	// Limit the result
	return inMemoryPagination.newPage(
			Arrays.stream(StringUtils.splitByWholeSeparator(StringUtils.defaultString(request.getResponse()), "<a href=\"")).skip(1)
					.filter(s -> format.format(s).contains(formatCriteria))
					.map(s -> StringUtils.removeEnd(s.substring(0, Math.max(0, s.indexOf('\"'))), "/"))
					.filter(((Predicate<String>) String::isEmpty).negate()).map(id -> new NamedBean<>(id, id)).collect(Collectors.toList()),
					PageRequest.of(0, 10)).getContent();
}
 
開發者ID:ligoj,項目名稱:plugin-scm,代碼行數:30,代碼來源:AbstractIndexBasedPluginResource.java

示例3: getConfluenceResource

/**
 * Return a Jenkins's resource. Return <code>null</code> when the resource
 * is not found.
 */
protected String getConfluenceResource(final CurlProcessor processor, final String url, final String resource) {
	// Get the resource using the preempted authentication
	final CurlRequest request = new CurlRequest(HttpMethod.GET, StringUtils.removeEnd(url, "/") + resource, null);
	request.setSaveResponse(true);

	// Execute the requests
	processor.process(request);
	processor.close();
	return request.getResponse();
}
 
開發者ID:ligoj,項目名稱:plugin-km-confluence,代碼行數:14,代碼來源:ConfluencePluginResource.java

示例4: validateAdminAccess

/**
 * Validate the administration connectivity. Expect an authenticated connection.
 */
private void validateAdminAccess(final Map<String, String> parameters, final CurlProcessor processor) {
	final CurlRequest request = new CurlRequest(HttpMethod.GET, StringUtils.appendIfMissing(parameters.get(parameterUrl), "/"), null);
	request.setSaveResponse(true);
	// Request all repositories access
	if (!processor.process(request) || !StringUtils.contains(request.getResponse(), "<a href=\"/\">")) {
		throw new ValidationJsonException(parameterUrl, simpleName + "-admin", parameters.get(parameterUser));
	}
}
 
開發者ID:ligoj,項目名稱:plugin-scm,代碼行數:11,代碼來源:AbstractIndexBasedPluginResource.java

示例5: validateRepository

/**
 * Validate the repository.
 * 
 * @param parameters
 *            the space parameters.
 * @return Content of root of given repository.
 */
protected String validateRepository(final Map<String, String> parameters) {
	final CurlRequest request = new CurlRequest(HttpMethod.GET, getRepositoryUrl(parameters), null);
	request.setSaveResponse(true);
	// Check repository exists
	if (!newCurlProcessor(parameters).process(request)) {
		throw new ValidationJsonException(parameterRepository, simpleName + "-repository", parameters.get(parameterRepository));
	}
	return request.getResponse();
}
 
開發者ID:ligoj,項目名稱:plugin-scm,代碼行數:16,代碼來源:AbstractIndexBasedPluginResource.java

示例6: list

@Path(value = "items", method = HttpMethod.GET)
Response<LoadItemsResponse> list();
 
開發者ID:GwtDomino,項目名稱:domino-todolist,代碼行數:2,代碼來源:TodoItemsRequests.java

示例7:

@Path(value = "somePath3", method = HttpMethod.GET)
Response<ResponseBean> something3(RequestBean request);
 
開發者ID:GwtDomino,項目名稱:domino,代碼行數:2,代碼來源:AnnotatedInterfaceWithRequestGroup.java

示例8: get

/**
 * GETメソッドとしてDcRequestオブジェクトを生成する.
 * @param url URL
 * @return req DcRequestオブジェクト
 */
public static PersoniumRequest get(String url) {
    PersoniumRequest req = new PersoniumRequest(url);
    req.method = HttpMethod.GET;
    return req;
}
 
開發者ID:personium,項目名稱:personium-core,代碼行數:10,代碼來源:PersoniumRequest.java


注:本文中的javax.ws.rs.HttpMethod.GET屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。