Package javax.ws.rs.core

Examples of javax.ws.rs.core.UriBuilder.queryParam()


    public static UriBuilder getAuthorizationURIBuilder(String authorizationServiceURI,
                                                 String clientId,
                                                 String scope) {
        UriBuilder ub = UriBuilder.fromUri(authorizationServiceURI);
        if (clientId != null) {
            ub.queryParam(OAuthConstants.CLIENT_ID, clientId);
        }
        if (scope != null) {
            ub.queryParam(OAuthConstants.SCOPE, scope);
        }
        ub.queryParam(OAuthConstants.RESPONSE_TYPE, OAuthConstants.CODE_RESPONSE_TYPE);
View Full Code Here


        UriBuilder ub = UriBuilder.fromUri(authorizationServiceURI);
        if (clientId != null) {
            ub.queryParam(OAuthConstants.CLIENT_ID, clientId);
        }
        if (scope != null) {
            ub.queryParam(OAuthConstants.SCOPE, scope);
        }
        ub.queryParam(OAuthConstants.RESPONSE_TYPE, OAuthConstants.CODE_RESPONSE_TYPE);
        return ub;                                  
    }
   
View Full Code Here

            ub.queryParam(OAuthConstants.CLIENT_ID, clientId);
        }
        if (scope != null) {
            ub.queryParam(OAuthConstants.SCOPE, scope);
        }
        ub.queryParam(OAuthConstants.RESPONSE_TYPE, OAuthConstants.CODE_RESPONSE_TYPE);
        return ub;                                  
    }
   
    /**
     * Obtains the access token from OAuth AccessToken Service
View Full Code Here

            return null;
        } else {
            try {
                SamlRequestInfo info = createSamlResponseInfo(m);
                UriBuilder ub = UriBuilder.fromUri(getIdpServiceAddress());
                ub.queryParam(SAML_REQUEST, info.getEncodedSamlRequest());
                if (info.getRelayState() != null) {
                    ub.queryParam(RELAY_STATE, info.getRelayState());   
                }
                return Response.seeOther(ub.build()).build();
            } catch (Exception ex) {
View Full Code Here

            try {
                SamlRequestInfo info = createSamlResponseInfo(m);
                UriBuilder ub = UriBuilder.fromUri(getIdpServiceAddress());
                ub.queryParam(SAML_REQUEST, info.getEncodedSamlRequest());
                if (info.getRelayState() != null) {
                    ub.queryParam(RELAY_STATE, info.getRelayState());   
                }
                return Response.seeOther(ub.build()).build();
            } catch (Exception ex) {
                throw new WebApplicationException(ex);
            }
View Full Code Here

        .scheme("http")
        .host(assignedTask.getSlaveHost())
        .port(port.get());
    for (Entry<String, List<String>> entry : uriInfo.getQueryParameters().entrySet()) {
      for (String value : entry.getValue()) {
        redirect.queryParam(entry.getKey(), value);
      }
    }

    return Response.temporaryRedirect(redirect.build()).build();
  }
View Full Code Here

    }
   
    private Response getLink(File zipDir, Message m) {
        if (zipDir.exists() && new File(zipDir.getAbsolutePath(), "src.zip").exists()) {
            UriBuilder builder = ui.getAbsolutePathBuilder();
            String link = builder.queryParam(SOURCE_QUERY).build().toString();
            // TODO : move it into a resource template
            StringBuilder sb = new StringBuilder();
            sb.append("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
            sb.append("<head><title>Download the source</title></head>");
            sb.append("<body>");
View Full Code Here

   
    private URI buildCallbackURI(String callback, final Map<String, String> queryParams) {

        UriBuilder builder = UriBuilder.fromUri(callback);
        for (Map.Entry<String, String> entry : queryParams.entrySet()) {
            builder.queryParam(entry.getKey(), entry.getValue());
        }

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

    }

    public void testQueryIllegal() {
        UriBuilder uriBuilder = UriBuilder.fromPath("");
        try {
            uriBuilder.queryParam("a", (Object)null);
            fail();
        } catch (IllegalArgumentException e) {
            // expected
        }
View Full Code Here

            // expected
        }

        uriBuilder = UriBuilder.fromPath("");
        try {
            uriBuilder.queryParam("a", "abcd", null);
            fail();
        } catch (IllegalArgumentException e) {
            // expected
        }
    }
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.