@@ -0,0 +1,3285 @@
+package pinterest;%0A%0Aimport org.apache.http.client.utils.URIBuilder;%0A%0Aimport java.net.URI;%0Aimport java.net.URISyntaxException;%0A%0Aimport static org.apache.commons.lang3.StringUtils.isNotBlank;%0A%0Apublic class EndPointURIBuilder %7B%0A    private static final String PROTOCOL = %22https%22;%0A    private static final String HOST = %22api.pinterest.com%22;%0A    private static final String PIN_PATH = %22/v1/pins/%7BPIN_ID%7D/%22;%0A    private static final String MY_PIN_PATH = %22/v1/me/pins/%22;%0A    private static final String BOARD_PIN_PATH = %22/v1/boards/%7BBOARD_NAME%7D/pins/%22;%0A    private static final String BOARD_PATH = %22/v1/boards/%7BUSER_NAME%7D/%7BBOARD_NAME%7D/%22;%0A    private static final String MY_BOARD_PATH = %22/v1/me/boards/%22;%0A%0A    public static URI buildPinUri(final String accessToken, final String id, final String fields) throws URISyntaxException %7B%0A        final URIBuilder uriBuilder =  new URIBuilder()%0A                .setScheme(PROTOCOL)%0A                .setHost(HOST)%0A                .setPath(PIN_PATH.replace(%22%7BPIN_ID%7D%22, id))%0A                .setParameter(%22access_token%22, accessToken);%0A%0A        if (isNotBlank(fields)) %7B%0A            uriBuilder.setParameter(%22fields%22, fields);%0A        %7D%0A%0A        return uriBuilder.build();%0A    %7D%0A%0A    public static URI buildMyPinUri(final String accessToken, final String fields) throws URISyntaxException %7B%0A        final URIBuilder uriBuilder =  new URIBuilder()%0A                .setScheme(PROTOCOL)%0A                .setHost(HOST)%0A                .setPath(MY_PIN_PATH)%0A                .setParameter(%22access_token%22, accessToken);%0A%0A        if (isNotBlank(fields)) %7B%0A            uriBuilder.setParameter(%22fields%22, fields);%0A        %7D%0A%0A        return uriBuilder.build();%0A    %7D%0A%0A    public static URI buildBoardPinUri(final String accessToken, final String name, final String fields) throws URISyntaxException %7B%0A        final URIBuilder uriBuilder = new URIBuilder()%0A                .setScheme(PROTOCOL)%0A                .setHost(HOST)%0A                .setPath(BOARD_PIN_PATH.replace(%22%7BBOARD_NAME%7D%22, name))%0A                .setParameter(%22access_token%22, accessToken);%0A%0A        if (isNotBlank(fields)) %7B%0A            uriBuilder.setParameter(%22fields%22, fields);%0A        %7D%0A%0A        return uriBuilder.build();%0A    %7D%0A%0A    public static URI buildBoardUri(final String accessToken, final String userName, final String boardName, final String fields) throws URISyntaxException %7B%0A        final URIBuilder uriBuilder = new URIBuilder()%0A                .setScheme(PROTOCOL)%0A                .setHost(HOST)%0A                .setPath(BOARD_PATH.replace(%22%7BUSER_NAME%7D%22, userName).replace(%22%7BBOARD_NAME%7D%22, boardName))%0A                .setParameter(%22access_token%22, accessToken);%0A%0A        if (isNotBlank(fields)) %7B%0A            uriBuilder.setParameter(%22fields%22, fields);%0A        %7D%0A%0A        return uriBuilder.build();%0A    %7D%0A%0A    public static URI buildMyBoardUri(final String accessToken, final String fields) throws URISyntaxException %7B%0A        final URIBuilder uriBuilder = new URIBuilder()%0A                .setScheme(PROTOCOL)%0A                .setHost(HOST)%0A                .setPath(MY_BOARD_PATH)%0A                .setParameter(%22access_token%22, accessToken);%0A%0A        if (isNotBlank(fields)) %7B%0A            uriBuilder.setParameter(%22fields%22, fields);%0A        %7D%0A%0A        return uriBuilder.build();%0A    %7D%0A%7D%0A

Move end point URI builder to separate class