当前位置: 首页>>代码示例>>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;未经允许,请勿转载。