package com.proxerme.library.info;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

/**
 * Helper class, containing all the different Urls for accessing the API.
 *
 * @author Ruben Gees
 */
public class ProxerUrlHolder {

    private static final String HOST = "https://proxer.me";
    private static final String NEWS = "/forum/%s/%s%s#top";
    private static final String DONATE = "/donate%s";
    private static final String NEWS_IMAGE = "http://cdn.proxer.me/news/tmp/%s_%s.png";
    private static final String USER_IMAGE = "http://cdn.proxer.me/avatar/%s";

    /**
     * Returns the host of the API.
     *
     * @return The url.
     */
    @NonNull
    public static String getHost() {
        return HOST;
    }

    /**
     * Returns the url for a single image of a news.
     *
     * @param newsId  The id of the news.
     * @param imageId The id of the image.
     * @return The url.
     */
    @NonNull
    public static String getNewsImageUrl(@NonNull String newsId, @NonNull String imageId) {
        return String.format(NEWS_IMAGE, newsId, imageId);
    }

    /**
     * Returns the url to a single newspage. This is not part of the REST-Api, but the link to the
     * webpage.
     *
     * @param categoryId The id of the category of the news.
     * @param threadId   The id of the thred.
     * @return The url.
     */
    @NonNull
    public static String getNewsUrl(@NonNull String categoryId, @NonNull String threadId,
                                    @Nullable String device) {
        return String.format(getHost() + NEWS, categoryId, threadId,
                device == null ? "?device=default" : "?device=" + device);
    }

    /**
     * Returns the url to a single image of a user.
     *
     * @param imageLink The link to the image.
     * @return The url.
     */
    @NonNull
    public static String getUserImageUrl(@NonNull String imageLink) {
        return String.format(USER_IMAGE, imageLink);
    }

    /**
     * Returns the url for the donation page.
     *
     * @return The url.
     */
    @NonNull
    public static String getDonateUrl(@Nullable String device) {
        return String.format(getHost() + DONATE,
                device == null ? "?device=default" : "?device=" + device);
    }


}

@@ -473,32 +473,33 @@
 WS_IMAGE = %22http
+s
 ://cdn.proxer.me
@@ -570,16 +570,17 @@
  = %22http
+s
 ://cdn.p
@@ -599,16 +599,100 @@
 tar/%25s%22;
+%0A    private static final String COVER_IMAGE = %22https://cdn.proxer.me/cover/%25s.jpg%22;
 %0A%0A    /*
@@ -2069,32 +2069,173 @@
 geLink);%0A    %7D%0A%0A
+    @NonNull%0A    public static String getCoverImageUrl(@NonNull String entryId) %7B%0A        return String.format(COVER_IMAGE, entryId);%0A    %7D%0A%0A
     /**%0A     * R

Make all cdn links https encrypted; New Url: cover image