use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class Resource method getLocation.
@POST
@Path("getlocation")
public Response getLocation(String uri) throws URISyntaxException {
ResponseBuilder builder = createResponseWithHeader();
if (uri != null && uri.length() != 0)
builder = builder.location(new URI(uri));
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 getDate.
@POST
@Path("getdate")
public Response getDate(String text) {
ResponseBuilder builder = createResponseWithHeader();
if (text != null && text.length() != 0) {
long milis = Long.valueOf(text);
Date date = new Date(milis);
builder = builder.header("Date", date);
}
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 getHeadersIsMutable.
@GET
@Path("getheadersismutable")
public Response getHeadersIsMutable() {
ResponseBuilder builder = createResponseWithHeader();
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 hasEntity.
@POST
@Path("hasentity")
public Response hasEntity(String entity) {
ResponseBuilder builder = createResponseWithHeader();
if (entity != null && entity.length() != 0)
builder = builder.entity(entity);
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 getHeaderStringByHeader.
@POST
@Path("getheaderstringheader")
public Response getHeaderStringByHeader(String content) {
ResponseBuilder builder = createResponseWithHeader();
if (content.equals("toString"))
builder = builder.header(ResponseFilter.HEADER, new StringBuilder().append(ResponseFilter.ENTITY));
if (content.equals("commaSeparated")) {
builder = builder.header(ResponseFilter.HEADER, new StringBuilder().append(ResponseFilter.ENTITY));
builder = builder.header(ResponseFilter.HEADER, ResponseFilter.ENTITY);
}
if (content.equals("headerDelegate")) {
StringBean bean = new StringBean(ResponseFilter.ENTITY);
builder = builder.header(ResponseFilter.HEADER, bean);
}
if (content.equalsIgnoreCase("entity"))
builder = builder.header(ResponseFilter.HEADER, content);
Response response = builder.build();
return response;
}
Aggregations