Examples of buildFromMap()


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

    URI uri;
    List<String> paramNames = ((UriBuilderImpl)uriBuilder).getPathParamNamesInDeclarationOrder();
    if(paramNames.isEmpty())
      uri = uriBuilder.build();
    else if(pathParameters.size() >= paramNames.size())
      uri = uriBuilder.buildFromMap(pathParameters);
    else
      // just bail out since we don't have enough parameters, that must be an instance service
      return;
    if(rel.length() == 0){
      if (m.isAnnotationPresent(GET.class))
View Full Code Here

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

      try
      {
         ub = UriBuilder.fromPath("").path("{w}/{x}/{y}/{z}/{x}");

         uri = ub.buildFromMap(maps);

         if (uri.getRawPath().compareToIgnoreCase(expected_path) != 0)
         {
            pass = false;
            sb.append("Test failed for expected path: " + expected_path +
View Full Code Here

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

         else
         {
            sb.append("Got expected path: " + uri.getRawPath() + "\n");
         }

         uri = ub.buildFromMap(maps1);

         if (uri.getRawPath().compareToIgnoreCase(expected_path_1) != 0)
         {
            pass = false;
            sb.append("Test failed for expected path: " + expected_path_1 +
View Full Code Here

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

         else
         {
            sb.append("Got expected path: " + uri.getRawPath() + "\n");
         }

         uri = ub.buildFromMap(maps2);

         if (uri.getRawPath().compareToIgnoreCase(expected_path_2) != 0)
         {
            pass = false;
            sb.append("Test failed for expected path: " + expected_path_2 +
View Full Code Here

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

        }
        for (Map.Entry<String, Object> p : matrixParams.entrySet()) {
            uriBuilder.replaceMatrixParam(p.getKey(), p.getValue());
        }

        uri = uriBuilder.buildFromMap(pathParams);
        Resource resource = restClient.resource(uri);

        for (Map.Entry<String, Object> p : headerParams.entrySet()) {
            resource.header(p.getKey(), String.valueOf(p.getValue()));
        }
View Full Code Here

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

        map.put("v3", "a+b");
        map.put("v4", "c%2Bd");
        map.put("v5", "frag");

        // buildFromMap
        uri = builder.buildFromMap(map);
        uriString = uri.toString();
        assertEquals("//localhost:8080/some/path/pathEx/a+b/a+bc%252Bd#frag", uriString);

        // buildFromEncodedMap
        uri = builder.buildFromEncodedMap(map);
View Full Code Here

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

        Map<String, String> values = new HashMap<String, String>();
        values.put("a", "/%test%/");
        assertEquals("/%25test%25/", uriBuilder.buildFromEncodedMap(values).toASCIIString());

        uriBuilder = UriBuilder.fromPath("{a}");
        assertEquals("/%25test%25/", uriBuilder.buildFromMap(values).toASCIIString());

        uriBuilder = UriBuilder.fromPath("{a}");
        assertEquals("/%25test%25/", uriBuilder.buildFromEncoded("/%test%/").toASCIIString());

        uriBuilder = UriBuilder.fromPath("{a}");
View Full Code Here

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

         */
        UriBuilder uriBuilder = UriBuilder.fromPath("{w}");
        Map<String, Object> values = new HashMap<String, Object>();
        values.put("w", "pathwithslash/test2");

        URI uri = uriBuilder.buildFromMap(values);
        assertEquals("pathwithslash/test2", uri.toString());
    }

    public void testBuildWithEmptyString() {
        URI uri =
View Full Code Here

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

        }
        for (Map.Entry<String, Object> p : matrixParams.entrySet()) {
            uriBuilder.replaceMatrixParam(p.getKey(), p.getValue());
        }

        uri = uriBuilder.buildFromMap(pathParams);
        Resource resource = restClient.resource(uri);

        for (Map.Entry<String, Object> p : headerParams.entrySet()) {
            resource.header(p.getKey(), String.valueOf(p.getValue()));
        }
View Full Code Here

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

        }
        for (Map.Entry<String, Object> p : matrixParams.entrySet()) {
            uriBuilder.replaceMatrixParam(p.getKey(), p.getValue());
        }

        uri = uriBuilder.buildFromMap(pathParams);
        Resource resource = restClient.resource(uri);

        for (Map.Entry<String, Object> p : headerParams.entrySet()) {
            resource.header(p.getKey(), String.valueOf(p.getValue()));
        }
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.