Package javax.ws.rs.core.Response

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


                }
            }
        }
        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


    }
   
    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

            if (result.getSize() != -1L){
                builder.header("content-length",result.getSize());
            }

            if (!result.MIMEType.equals("")){
                builder.type(result.MIMEType);
            }
            builder.entity(result.getStream());
            return builder.build();
        }
    }
View Full Code Here

            if (outbound.size() > 0) {
                outbound.addToMultipart(mp, RestLogging.restLogger);
            }
            rb.entity(mp);
        } else {
            rb.type(MediaType.APPLICATION_JSON_TYPE);
            rb.entity(ar);
        }
        if ( isSingleInstanceCommand(model)) {
            rb.cookie(getJSessionCookie(jSessionId));
        }
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 (outbound.size() > 0) {
                outbound.addToMultipart(mp, logger);
            }
            rb.entity(mp);
        } else {
            rb.type(MediaType.APPLICATION_JSON_TYPE);
            rb.entity(ar);
        }
        if ( isSingleInstanceCommand(model)) {
            rb.cookie(getJSessionCookie(jSessionId));
        }
View Full Code Here

            builder = Response.fromResponse(webAppExcept.getResponse());
        } else {
            LOG.warn("Internal server error (500)", exception);
            builder = Response.status(500).entity(exception);
        }
        return builder.type(BaseJsonResource.JSON_CONTENT_TYPE).build();
    }
}
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

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.