Java Code Examples for com.sun.jersey.api.client.WebResource#path()

The following examples show how to use com.sun.jersey.api.client.WebResource#path() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AtlasBaseClient.java    From atlas with Apache License 2.0 5 votes vote down vote up
private WebResource appendPathParams(WebResource resource, String[] pathParams) {
    if (pathParams != null) {
        for (String pathParam : pathParams) {
            resource = resource.path(pathParam);
        }
    }
    return resource;
}
 
Example 2
Source File: ProductTypeClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRange_JSON(Class<T> responseType, String from, String to) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("{0}/{1}", new Object[]{from, to}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 3
Source File: CumulativeLiveSalesClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRegionRange_JSON(Class<T> responseType, String from, String to) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("region/{0}/{1}", new Object[]{from, to}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 4
Source File: FullProductListingClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRange_JSON(Class<T> responseType, String from, String to) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("{0}/{1}", new Object[]{from, to}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 5
Source File: LiveSalesViewClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRecentRegion_JSON(Class<T> responseType, String region) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("/recent/region/{0}", new Object[]{region}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 6
Source File: LiveSalesViewClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRecentRegionFrom_JSON(Class<T> responseType, String region, Integer orderLineId) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("/recent/region/{0}/{1}", new Object[]{region, orderLineId.toString()}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 7
Source File: LiveSalesViewClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRecentRegionProductType_JSON(Class<T> responseType, String region, Integer productTypeId) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("/recent/region/producttype/{0}/{1}", new Object[]{region, productTypeId.toString()}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 8
Source File: LiveSalesViewClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRecentRegionProductTypeFrom_JSON(Class<T> responseType, String region, Integer productTypeId, Integer orderLineId) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("/recent/region/producttype/{0}/{1}/{2}", new Object[]{region, productTypeId.toString(), orderLineId.toString()}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 9
Source File: HeatMapClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T getDateRange_XML(Class<T> responseType) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path("range");
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType);
}
 
Example 10
Source File: ProductTypeClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T find_XML(Class<T> responseType, String id) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("{0}", new Object[]{id}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType);
}
 
Example 11
Source File: HeatMapClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T getProductTypeHeatMap_XML(Class<T> responseType, Date date1, Date date2, Integer productTypeId1, Integer productTypeId2) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("/producttype/{0}/{1}/{2}/{3}", new Object[]{((Long)date1.getTime()).toString(), ((Long)date2.getTime()).toString(), productTypeId1.toString(), productTypeId2.toString()}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType);
}
 
Example 12
Source File: FullProductListingClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T find_JSON(Class<T> responseType, String id) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("{0}", new Object[]{id}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 13
Source File: CumulativeLiveSalesClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRegionStateRange_JSON(Class<T> responseType, String from, String to, Integer regionId) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("state/{0}/{1}/{2}", new Object[]{from, to, regionId}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 14
Source File: LiveSalesViewClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRecentRegionProductType_JSON(Class<T> responseType, String region, Integer productTypeId) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("/recent/region/producttype/{0}/{1}", new Object[]{region, productTypeId.toString()}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 15
Source File: RegionClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRange_XML(Class<T> responseType, String from, String to) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("{0}/{1}", new Object[]{from, to}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType);
}
 
Example 16
Source File: RegionClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public String countREST() throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path("count");
    return resource.accept(javax.ws.rs.core.MediaType.TEXT_PLAIN).get(String.class);
}
 
Example 17
Source File: LiveSalesViewClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T find_JSON(Class<T> responseType, String id) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("{0}", new Object[]{id}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}
 
Example 18
Source File: ProductTypeClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T find_XML(Class<T> responseType, String id) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("{0}", new Object[]{id}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType);
}
 
Example 19
Source File: LiveSalesViewClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T find_XML(Class<T> responseType, String id) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("{0}", new Object[]{id}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType);
}
 
Example 20
Source File: CumulativeLiveSalesClient.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public <T> T findRegionStateRange_JSON(Class<T> responseType, String from, String to, Integer regionId) throws UniformInterfaceException {
    WebResource resource = webResource;
    resource = resource.path(java.text.MessageFormat.format("state/{0}/{1}/{2}", new Object[]{from, to, regionId}));
    return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(responseType);
}