Package javax.ws.rs.core.Response

Examples of javax.ws.rs.core.Response.ResponseBuilder.type()


            if (!allowedMethods.contains("HEAD") && allowedMethods.contains("GET")) {
                rb.header("Allow", "HEAD");
            }
        }
        if (msg != null && MessageUtils.isTrue(msg.getContextualProperty(REPORT_FAULT_MESSAGE_PROPERTY))) {
            rb.type(MediaType.TEXT_PLAIN_TYPE).entity(responseMessage);
        }
        return rb.build();
    }
   
    private static boolean matchHttpMethod(String expectedMethod, String httpMethod) {
View Full Code Here


            if (!allowedMethods.contains("HEAD") && allowedMethods.contains("GET")) {
                rb.header("Allow", "HEAD");
            }
        }
        if (msg != null && MessageUtils.isTrue(msg.getContextualProperty(REPORT_FAULT_MESSAGE_PROPERTY))) {
            rb.type(MediaType.TEXT_PLAIN_TYPE).entity(responseMessage);
        }
        return rb.build();
    }
   
    private static boolean matchHttpMethod(String expectedMethod, String httpMethod) {
View Full Code Here

            if (!allowedMethods.contains("HEAD") && allowedMethods.contains("GET")) {
                rb.header("Allow", "HEAD");
            }
        }
        if (msg != null && MessageUtils.isTrue(msg.getContextualProperty(REPORT_FAULT_MESSAGE_PROPERTY))) {
            rb.type(MediaType.TEXT_PLAIN_TYPE).entity(responseMessage);
        }
        return rb.build();
    }
   
    private static boolean matchHttpMethod(String expectedMethod, String httpMethod) {
View Full Code Here

    }
   
    protected void reportInvalidClient(OAuthError error) {
        ResponseBuilder rb = JAXRSUtils.toResponseBuilder(401);
        throw ExceptionUtils.toNotAuthorizedException(null,
            rb.type(MediaType.APPLICATION_JSON_TYPE).entity(error).build());
    }
   
    public void setCanSupportPublicClients(boolean support) {
        this.canSupportPublicClients = support;
    }
View Full Code Here

            if (!allowedMethods.contains("HEAD") && allowedMethods.contains("GET")) {
                rb.header("Allow", "HEAD");
            }
        }
        if (msg != null && MessageUtils.isTrue(msg.getContextualProperty(REPORT_FAULT_MESSAGE_PROPERTY))) {
            rb.type(MediaType.TEXT_PLAIN_TYPE).entity(responseMessage);
        }
        return rb.build();
    }
   
    private static boolean matchHttpMethod(String expectedMethod, String httpMethod) {
View Full Code Here

            if (!allowedMethods.contains("HEAD") && allowedMethods.contains("GET")) {
                rb.header("Allow", "HEAD");
            }
        }
        if (msg != null && MessageUtils.isTrue(msg.getContextualProperty(REPORT_FAULT_MESSAGE_PROPERTY))) {
            rb.type(MediaType.TEXT_PLAIN_TYPE).entity(responseMessage);
        }
        return rb.build();
    }
   
    private static boolean matchHttpMethod(String expectedMethod, String httpMethod) {
View Full Code Here

                        // q=0 to ensure outbound flow rejects it
                        ResponseBuilder responseBuilder =
                            RuntimeDelegate.getInstance().createResponseBuilder();
                        // send back a media type that has q=0 -- this should be
                        // detected somewhere
                        responseBuilder.type(new MediaType("image", "jpeg"));
                        return responseBuilder.status(Response.Status.OK).entity("unknown string")
                            .build();
                    }
                }
            }
View Full Code Here

    }
   
    protected void reportInvalidClient(OAuthError error) {
        ResponseBuilder rb = JAXRSUtils.toResponseBuilder(401);
        throw ExceptionUtils.toNotAuthorizedException(null,
            rb.type(MediaType.APPLICATION_JSON_TYPE).entity(error).build());
    }
   
    public void setCanSupportPublicClients(boolean support) {
        this.canSupportPublicClients = support;
    }
View Full Code Here

                }
            }
        }
        String ct = (String)responseMessage.get(Message.CONTENT_TYPE);
        if (ct != null) {
            currentResponseBuilder.type(ct);
        }
        InputStream mStream = responseMessage.getContent(InputStream.class);
        currentResponseBuilder.entity(mStream);
       
        return currentResponseBuilder;
View Full Code Here

                }
            }
        }
        String ct = (String)responseMessage.get(Message.CONTENT_TYPE);
        if (ct != null) {
            currentResponseBuilder.type(ct);
        }
        InputStream mStream = responseMessage.getContent(InputStream.class);
        currentResponseBuilder.entity(mStream);
       
        return currentResponseBuilder;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.