use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.
the class UpdateRequestUriBuilder method getUriBuilderWithoutQueryParams.
@Override
protected UriBuilder getUriBuilderWithoutQueryParams() {
UpdateRequest<?> updateRequest = getRequest();
UriBuilder b = super.getUriBuilderWithoutQueryParams();
appendKeyToPath(b, updateRequest.getId());
return b;
}
use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.
the class RestUtils method buildPaginatedUri.
private static String buildPaginatedUri(final URI requestUri, final int start, final Integer count) {
UriBuilder builder = UriBuilder.fromUri(requestUri);
builder.replaceQueryParam("start", String.valueOf(start));
builder.replaceQueryParam("count", String.valueOf(count));
return builder.build().toString();
}
use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.
the class PartialUpdateRequestUriBuilder method getUriBuilderWithoutQueryParams.
@Override
protected UriBuilder getUriBuilderWithoutQueryParams() {
PartialUpdateRequest<?> partialUpdateRequest = getRequest();
UriBuilder b = super.getUriBuilderWithoutQueryParams();
appendKeyToPath(b, partialUpdateRequest.getId());
return b;
}
use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.
the class TestUriParamUtils method addSortedParams.
@Test
public void addSortedParams() {
DataMap queryParams = new DataMap();
DataMap aParamMap = new DataMap();
aParamMap.put("someField", "someValue");
aParamMap.put("foo", "bar");
aParamMap.put("empty", new DataMap());
DataList bParamList = new DataList();
bParamList.add("x");
bParamList.add("y");
bParamList.add("z");
queryParams.put("aParam", aParamMap);
queryParams.put("bParam", bParamList);
UriBuilder uriBuilder = new UriBuilder();
URIParamUtils.addSortedParams(uriBuilder, queryParams);
String query = uriBuilder.build().getQuery();
Assert.assertEquals(query, "aParam=(empty:(),foo:bar,someField:someValue)&bParam=List(x,y,z)");
}
use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.
the class BatchCreateResponseBuilder method getLocationUri.
// construct location uri for each created entity id
private String getLocationUri(Request request, Object id, Object altKey, ProtocolVersion protocolVersion) {
if (id == null) {
// location uri is only set if object key is returned
return null;
}
String stringKey = URIParamUtils.encodeKeyForUri(id, UriComponent.Type.PATH_SEGMENT, protocolVersion);
UriBuilder uribuilder = UriBuilder.fromUri(request.getURI());
uribuilder.path(stringKey);
uribuilder.replaceQuery(null);
if (altKey != null) {
// add altkey param to location URI
uribuilder.queryParam(RestConstants.ALT_KEY_PARAM, altKey);
}
return uribuilder.build((Object) null).toString();
}
Aggregations