Package org.apache.shindig.common.uri

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


          "; only \"http\" and \"https\" supported.", HttpResponse.SC_BAD_REQUEST);
    }
    if (url.getPath() == null || url.getPath().length() == 0) {
      url.setPath("/");
    }
    return url.toUri();
  }
 
  /**
   * Sets standard forwarding headers on the proxied request.
   * @param inboundRequest
View Full Code Here


    Preconditions.checkNotNull(token, "No token available for social preloads");

    UriBuilder builder = UriBuilder.parse(
        jsonUri.replace("%host%", context.getHost()))
        .addQueryParameter("st", token);
    return builder.toUri();
  }
}
View Full Code Here

        } else {
          UriBuilder uriBuilder = new UriBuilder(request.getUri());
          String query = uriBuilder.getQuery();
          query = query == null ? params : query + '&' + params;
          uriBuilder.setQuery(query);
          request.setUri(uriBuilder.toUri());
        }
      }

      return new Data(requestPipeline.execute(request));
    }
View Full Code Here

      if (doSplit) {
        snippets.put(resource, getJsSnippet(splitParam, resource));
      }
    }
   
    return new ConcatData(uriBuilder.toUri(), snippets);
  }
 
  static String getJsSnippet(String splitParam, Uri resource) {
    return String.format(CONCAT_JS_EVAL_TPL, splitParam,
        StringEscapeUtils.escapeJavaScript(resource.toString()));
View Full Code Here

          !securityTokenOnQuery);
    }
   
    addExtras(uri);
   
    return uri.toUri();
  }

  protected String generateSecurityToken(Gadget gadget) {
    // Find a security token in the context
    try {
View Full Code Here

    // Query-style syntax. Use path as normal and append query params at the end.
    queryBuilder.addQueryParameter(Param.URL.getKey(), puc.getResource().toString());
    uri.setQuery(queryBuilder.getQuery());
    uri.setPath(path);

    return uri.toUri();
  }

  @SuppressWarnings("deprecation")
  public ProxyUri process(Uri uriIn) throws GadgetException {
    UriStatus status = UriStatus.BAD_URI;
View Full Code Here

    if (versioner != null && !gadget.getContext().getIgnoreCache()) {
      uri.addQueryParameter(Param.VERSION.getKey(),
          versioner.version(gadget.getContext().getUrl(), container, extern));
    }

    return uri.toUri();
  }

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

      UriBuilder newUri = new UriBuilder(origUri);
      newUri.addQueryParameter(Param.SANITIZE.getKey(), "1");
      if (expectedMime != null) {
        newUri.addQueryParameter(Param.REWRITE_MIME_TYPE.getKey(), expectedMime);
      }
      sanitizedUris.add(newUri.toUri());
    }
     
    return sanitizedUris;
  }
}
View Full Code Here

    uri.addQueryParameter("country", context.getLocale().getCountry());

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

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

          "; only \"http\" and \"https\" supported.", HttpResponse.SC_BAD_REQUEST);
    }
    if (url.getPath() == null || url.getPath().length() == 0) {
      url.setPath("/");
    }
    return url.toUri();
  }
 
  /**
   * Sets standard forwarding headers on the proxied request.
   * @param inboundRequest
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.