use of jakarta.ws.rs.core.PathSegment in project jaxrs-api by eclipse-ee4j.
the class Resource method createResponseWithHeader.
// //////////////////////////////////////////////////////////////////
private ResponseBuilder createResponseWithHeader() {
// get value of @Path(value)
List<PathSegment> segments = info.getPathSegments();
PathSegment last = segments.get(segments.size() - 1);
// convert the value to ContextOperation
ContextOperation op = ContextOperation.valueOf(last.getPath().toUpperCase());
Response.ResponseBuilder builder = Response.ok();
// set a header with ContextOperation so that the filter knows what to
// do
builder = builder.header(ResponseFilter.OPERATION, op.name());
return builder;
}
use of jakarta.ws.rs.core.PathSegment in project jaxrs-api by eclipse-ee4j.
the class Resource method createResponseWithHeader.
private Response createResponseWithHeader() {
// get value of @Path(value)
List<PathSegment> segments = info.getPathSegments();
PathSegment last = segments.get(segments.size() - 1);
// convert the value to ContextOperation
ContextOperation op = ContextOperation.valueOf(last.getPath().toUpperCase());
Response.ResponseBuilder builder = Response.ok();
// set a header with ContextOperation so that the filter knows what to
// do
builder = builder.header(TemplateFilter.OPERATION, op.name());
return builder.build();
}
Aggregations