use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class Resource method getLength.
@POST
@Path("getlength")
public Response getLength(String entity) {
ResponseBuilder builder = createResponseWithHeader();
if (entity != null && entity.length() != 0)
builder = builder.entity(entity).header(HttpHeaders.CONTENT_LENGTH, entity.length());
Response response = builder.build();
return response;
}
use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class Resource method getLanguage.
@POST
@Path("getlanguage")
public Response getLanguage(String language) {
ResponseBuilder builder = createResponseWithHeader();
if (language != null && language.length() != 0)
builder = builder.language(language);
Response response = builder.build();
return response;
}
use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class Resource method getLinks.
@POST
@Path("getlinks")
public Response getLinks(String uris) {
ResponseBuilder builder = createResponseWithHeader();
if (uris != null && uris.length() != 0) {
String[] tokens = uris.split(";");
Link[] links = new Link[tokens.length];
for (int i = 0; i != tokens.length; i++) links[i] = Link.fromUri(tokens[i]).build();
builder = builder.links(links);
}
Response response = builder.build();
return response;
}
use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class Resource method getEntityTag.
@POST
@Path("getentitytag")
public Response getEntityTag(String tagName) {
ResponseBuilder builder = createResponseWithHeader();
if (tagName != null && tagName.length() != 0) {
EntityTag tag = new EntityTag(tagName);
builder = builder.tag(tag);
}
Response response = builder.build();
return response;
}
use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class Resource method getCookiesIsReadOnly.
@Path("getcookiesisreadonly")
@GET
public Response getCookiesIsReadOnly() {
ResponseBuilder builder = createResponseWithHeader();
Response response = builder.build();
return response;
}
Aggregations