package me.shoutto.sdk.internal.http;

import me.shoutto.sdk.StmBaseEntity;

/**
 * Implementation of URL provider for Shout to Me API service endpoints
 */

public class DefaultUrlProvider implements StmUrlProvider {

    private String baseApiUrl;

    public DefaultUrlProvider(String baseApiUrl) {
        this.baseApiUrl = baseApiUrl;
    }

    @Override
    public String getUrl(StmBaseEntity entity, HttpMethod httpMethod) {
        String url = String.format("%s%s", baseApiUrl, entity.getBaseEndpoint());
        if (httpMethod.equals(HttpMethod.DELETE) || httpMethod.equals(HttpMethod.PUT)
                || httpMethod.equals(HttpMethod.GET)) {
            url = url.concat(String.format("/%s", entity.getId()));
        }
        return url;
    }
}

@@ -646,24 +646,70 @@
 hod.GET)) %7B%0A
+            if (entity.getId() != null) %7B%0A    
             
@@ -760,24 +760,38 @@
 .getId()));%0A
+            %7D%0A
         %7D%0A  

Add some protection to default url provider