本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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));
}
}
示例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();
}