Package org.apache.shindig.common.uri

Examples of org.apache.shindig.common.uri.UriBuilder.toUri()


    }
    if (ctx.getExtensionParams() != null) {
      uri.addQueryParameters(ctx.getExtensionParams());
    }

    return uri.toUri();
  }

  /**
   * Essentially pulls apart a Uri created by makeExternJsUri, validating its
   * contents, especially the version key.
View Full Code Here


    uri.addQueryParameter(Param.URL.getKey(), SPEC_URI.toString());
    uri.addQueryParameter(Param.CONTAINER.getKey(), CONTAINER);
    if (version != null) {
      uri.addQueryParameter(Param.VERSION.getKey(), version);
    }
    return uri.toUri();
  }

  private TestDefaultIframeUriManager makeManager(boolean alwaysToken, boolean ldRequired)
      throws ContainerConfigException {
    return makeManager(alwaysToken, ldRequired, ldRequired ? true: false);
View Full Code Here

          for (Uri uri : batch.getBatch()) {
            snippets.put(uri, uri.toString());
          }
          uriBuilder.addQueryParameter("SPLIT", "1");
        }
        results.add(new ConcatData(Lists.newArrayList(uriBuilder.toUri()), snippets));
      }
      return results;
    }

    public ConcatUri process(Uri uri) {
View Full Code Here

      public SecurityToken getToken() {
        return new AnonymousSecurityToken();
      }
    });

    pipeline.plainResponses.put(uri.toUri(), new HttpResponse(PROXIED_HTML_CONTENT));
    String content = proxyRenderer.render(gadget);
    assertEquals(PROXIED_HTML_CONTENT, content);
  }

  @Test
View Full Code Here

      if (uriBuilder.toString().length() > injectedMaxUrlLength) {
        uriBuilder.removeQueryParameter(i.toString());

        addVersionAndSplitParam(uriBuilder, splitParam, doSplit, batchUris, container,
            ctx.getType());
        uris.add(uriBuilder.toUri());

        uriBuilder = makeUriBuilder(ctx, concatHost, concatPath);
        batchUris = Lists.newArrayList();
        i = START_INDEX;
        uriBuilder.addQueryParameter(i.toString(), resource.toString());
View Full Code Here

      batchUris.add(resource);
    }

    if (batchUris != null && uriBuilder != ctx.makeQueryParams(null, null)) {
      addVersionAndSplitParam(uriBuilder, splitParam, doSplit, batchUris, container, ctx.getType());
      uris.add(uriBuilder.toUri());
    }

    if (doSplit) {
      snippets = createSnippets(uris);
    }
View Full Code Here

    OAuthArguments oauthArgs = new OAuthArguments(view);
    OAuth2Arguments oauth2Args = new OAuth2Arguments(view);
    oauthArgs.setProxiedContentRequest(true);

    HttpRequest request = new HttpRequest(uri.toUri())
        .setIgnoreCache(context.getIgnoreCache())
        .setOAuthArguments(oauthArgs)
        .setOAuth2Arguments(oauth2Args)
        .setAuthType(view.getAuthType())
        .setSecurityToken(context.getToken())
View Full Code Here

    }

    // Overridable method to allow additional parameters
    addExtras(uri, gadget);

    return uri.toUri();
  }

  // Overrideable method to add extra logic for URL type gadget view
  protected UriBuilder processUriForUrlTypeView(View view, Gadget gadget) {
    // A. type=url. Initializes all except standard parameters.
View Full Code Here

            "; only \"http\" and \"https\" supported.");
      }
      if (url.getPath() == null || url.getPath().length() == 0) {
        url.setPath("/");
      }
      return url.toUri();
    } catch (IllegalArgumentException e) {
      throw new GadgetException(GadgetException.Code.INVALID_PARAMETER,
          "url parameter is not a valid url.");
    }
  }
View Full Code Here

      public SecurityToken getToken() {
        return new AnonymousSecurityToken();
      }
    });

    fetcher.plainResponses.put(uri.toUri(), new HttpResponse(PROXIED_HTML_CONTENT));
    String content = renderer.render(gadget);
    assertEquals(PROXIED_HTML_CONTENT, content);
  }

  @Test
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.