Package javax.ws.rs.core.Response

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


            List<String> rqAllowedHeaders = getHeadersFromInput(m,
                                                                CorsHeaderConstants.HEADER_AC_ALLOW_HEADERS);
            if (rqAllowedHeaders != null) {
                addHeaders(rbuilder, CorsHeaderConstants.HEADER_AC_ALLOW_HEADERS, rqAllowedHeaders, false);
            }
            return rbuilder.build();

        }
    }

    private boolean effectiveAllowAllOrigins(CrossOriginResourceSharing ann) {
View Full Code Here


                                     new Annotation[]{});
            rb = JAXRSUtils.fromResponse(currentResponse);
            rb.entity(entity instanceof Response
                      ? ((Response)entity).getEntity() : entity);
           
            return rb.build();
        } catch (Throwable ex) {
            throw (ex instanceof ClientWebApplicationException) ? (ClientWebApplicationException)ex
                                                              : new ClientWebApplicationException(ex);
        } finally {
            ProviderFactory.getInstance(outMessage).clearThreadLocalProxies();
View Full Code Here

            }
        }
        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) {
        if (expectedMethod.equalsIgnoreCase(httpMethod)
            || headMethodPossible(expectedMethod, httpMethod)) {
View Full Code Here

            if (realmName != null) {
                sb.append(" realm=\"").append(realmName).append('"');
            }
            builder.header(HttpHeaders.WWW_AUTHENTICATE, sb.toString());
           
            return builder.build();
        }
    }
   
    protected Response.Status getRedirectStatus() {
        return Response.Status.TEMPORARY_REDIRECT;
View Full Code Here

        checkSuspended();
        ResponseBuilder rb = Response.status(503);
        if (retryAfterHeader != null) {
            rb.header(HttpHeaders.RETRY_AFTER, retryAfterHeader);
        }
        doResume(rb.build());
        cancelled = true;
    }

    @Override
    public synchronized boolean isSuspended() {
View Full Code Here

            }
        }
        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) {
        if (expectedMethod.equalsIgnoreCase(httpMethod)
            || headMethodPossible(expectedMethod, httpMethod)) {
View Full Code Here

                }
            }
        }
       
               
        return rb.build();
    }
}
View Full Code Here

            if (effectiveExposeHeaders != null) {
                addHeaders(rbuilder, CorsHeaderConstants.HEADER_AC_EXPOSE_HEADERS,
                           effectiveExposeHeaders, false);
            }
            // if someone wants to clear the cache, we can't help them.
            return rbuilder.build();
        } else {
            // 5.2.8 max-age
            String maValue = (String)m.getExchange().get(CorsHeaderConstants.HEADER_AC_MAX_AGE);
            if (maValue != null) {
                rbuilder.header(CorsHeaderConstants.HEADER_AC_MAX_AGE, maValue);
View Full Code Here

            List<String> rqAllowedHeaders = getHeadersFromInput(m,
                                                                CorsHeaderConstants.HEADER_AC_ALLOW_HEADERS);
            if (rqAllowedHeaders != null) {
                addHeaders(rbuilder, CorsHeaderConstants.HEADER_AC_ALLOW_HEADERS, rqAllowedHeaders, false);
            }
            return rbuilder.build();

        }
    }

    private boolean effectiveAllowAllOrigins(CrossOriginResourceSharing ann) {
View Full Code Here

            if (realm != null) {
                sb.append(" realm=\"" + realm + "\"");
            }
            rb.header(HttpHeaders.WWW_AUTHENTICATE, sb.toString());
        }
        Response r = rb.build();
        throw ExceptionUtils.toNotAuthorizedException(null, r);
    }

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