Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.javaswift.joss.command.impl.account;
 
public class TenantCommandImpl extends AbstractSecureCommand<HttpGetTenantsimplements TenantCommand {
    public TenantCommandImpl(Account accountHttpClient httpClientAccess accessString url) {
        super(accounthttpClientmodifyUrl(url), access.getToken());
        setHeader(new Accept("application/json"));
    }
    protected static String modifyUrl(String authUrl) {
        return authUrl.replaceAll("/tokens""/tenants");
    }
    @Override
    protected Tenants getReturnObject(HttpResponse responsethrows IOException {
        return createObjectMapper(false)
                .readValue(response.getEntity().getContent(), Tenants.class);
    }
    @Override
    protected HttpGet createRequest(String url) {
        return new HttpGet(url);
    }
    @Override
    protected HttpStatusChecker[] getStatusCheckers() {
        return new HttpStatusChecker[] {
                new HttpStatusSuccessCondition(new HttpStatusRange(200, 299)),
                new HttpStatusFailCondition(new HttpStatusMatch(.))
        };
    }
New to GrepCode? Check out our FAQ X