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


Java Builder.delete方法代码示例

本文整理汇总了Java中javax.ws.rs.client.Invocation.Builder.delete方法的典型用法代码示例。如果您正苦于以下问题:Java Builder.delete方法的具体用法?Java Builder.delete怎么用?Java Builder.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.ws.rs.client.Invocation.Builder的用法示例。


在下文中一共展示了Builder.delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteStatusReturn

import javax.ws.rs.client.Invocation.Builder; //导入方法依赖的package包/类
@Override
public StatusResult deleteStatusReturn(WebTarget webClient, final String idName, final Long id,
		final Map<String, Object> pathParams,
		final Map<String, Object> queryParams, final Map<String, Object> builderProperties) throws Exception
{
	if (queryParams != null)
		webClient = applyQuery(webClient, queryParams);

	if (id != null && idName != null)
		webClient = webClient.resolveTemplate(idName, id);

	if (pathParams != null)
		webClient = webClient.resolveTemplates(pathParams);

       Builder builder = acceptMediaType(webClient.request());
       if (builderProperties != null){
           addBuilderProperties(builder, builderProperties);
       }
	Response resp = builder.delete();
	return getStatusResult(resp);

}
 
开发者ID:Appverse,项目名称:appverse-server,代码行数:23,代码来源:RestPersistenceService.java

示例2: delete

import javax.ws.rs.client.Invocation.Builder; //导入方法依赖的package包/类
@Override
public T delete(WebTarget webClient, final String idName, final Long id,
		final Map<String, Object> pathParams,
		final Map<String, Object> queryParams, final Map<String, Object> builderProperties) throws Exception
{
	if (queryParams != null)
		webClient = applyQuery(webClient, queryParams);

	GenericType<T> genericType = new GenericType<T>(getClassP()) {
	};

	if (id != null && idName != null)
		webClient = webClient.resolveTemplate(idName, id);

	if (pathParams != null)
		webClient = webClient.resolveTemplates(pathParams);

       Builder builder = acceptMediaType(webClient.request());
       if (builderProperties != null){
           addBuilderProperties(builder, builderProperties);
       }
	return builder.delete(genericType);
}
 
开发者ID:Appverse,项目名称:appverse-server,代码行数:24,代码来源:RestPersistenceService.java

示例3: delete

import javax.ws.rs.client.Invocation.Builder; //导入方法依赖的package包/类
void delete(MCRWork work) throws IOException, JDOMException, SAXException {
    WebTarget target = orcid.getWebTarget().path("work").path(work.getPutCode());
    Builder builder = buildInvocation(target);
    LOGGER.info("delete {} from {}", work.getObjectID(), target.getUri());
    Response response = builder.delete();
    expect(response, Response.Status.NO_CONTENT);
    orcid.getWorksSection().removeWork(work);
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:9,代码来源:MCRWorksPublisher.java

示例4: makeRemoteCall

import javax.ws.rs.client.Invocation.Builder; //导入方法依赖的package包/类
protected Response makeRemoteCall(String method, UriBuilder uri, Object arg)
        throws EcsManagementClientException {
    if (!isLoggedIn())
        login();
    Client jerseyClient = buildJerseyClient();
    Builder request = jerseyClient.target(uri)
            .register(LoggingFeature.class).request()
            .header("X-SDS-AUTH-TOKEN", authToken)
            .header("Accept", "application/xml");
    Response response;
    if (GET.equals(method)) {
        response = request.get();
    } else if (POST.equals(method)) {
        response = request.post(Entity.xml(arg));
    } else if (PUT.equals(method)) {
        response = request.put(Entity.xml(arg));
    } else if (DELETE.equals(method)) {
        response = request.delete();
    } else {
        throw new EcsManagementClientException(
                "Invalid request method: " + method);
    }
    if (response.getStatus() == 401 && authRetries < AUTH_RETRIES_MAX) {
        // attempt to re-authorize and retry up to _authMaxRetries_ times.
        authRetries += 1;
        this.authToken = null;
        response = makeRemoteCall(method, uri, arg);
    }
    return response;
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:31,代码来源:Connection.java

示例5: delete

import javax.ws.rs.client.Invocation.Builder; //导入方法依赖的package包/类
/**
 * Generic DELETE call.
 */
public <T> T delete(final String path, final Class<T> type,
    final RestParameter... parameters) throws ImClientException {
  try {
    logCallInfo(HttpMethods.DELETE, path);
    Builder clientConfigured = configureClient(path, parameters);
    return clientConfigured.delete(type);

  } catch (WebApplicationException exception) {
    throw new ImClientErrorException(createReponseError(exception));
  }
}
 
开发者ID:indigo-dc,项目名称:im-java-api,代码行数:15,代码来源:ImClient.java

示例6: deleteFile

import javax.ws.rs.client.Invocation.Builder; //导入方法依赖的package包/类
@DELETE
@Path(FILEPATH_PFX)
public Response deleteFile(@PathParam(FILEPATH_PARAM) String filePath) {
    final PathInfo pathInfo = splitWorkspacePath(filePath);
    Builder cheReqBuilder = getProjectTarget().path(pathInfo.path).request();
    Response cheResp = cheReqBuilder.delete();
    assertValidResponse(cheResp);
    return Response.ok().build();
}
 
开发者ID:tareqhs,项目名称:che_orion_api,代码行数:10,代码来源:FileService.java


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