Interface ImageUrlService

  • All Known Implementing Classes:
    AbsoluteImageUrlServiceImpl

    public interface ImageUrlService
    This services knows how to create urls from image ids.
    Since:
    5.11
    Author:
    Michiel Meeuwissen
    • Method Detail

      • getId

        default Long getId​(@NonNull Image image)
      • getIdFromImageUri

        default @Nullable Long getIdFromImageUri​(@Nullable String imageUri)
      • getImageBaseUrl

        String getImageBaseUrl()
        Returns the base url for image 'api' calls. For the backend server this is e.g. https://poms-test.omroep.nl/images/api for a frontend server this is e.g. https://images-test.poms.omroep.nl/
      • getOriginalUrl

        default @PolyNull String getOriginalUrl​(@PolyNull Long id)
      • getOriginalUrlFromImageUri

        default @Nullable String getOriginalUrlFromImageUri​(@Nullable String imageUri)
      • getImageLocation

        default String getImageLocation​(@NonNull String uri,
                                        @Nullable String fileExtension,
                                        String... conversions)
        Resolves a web location for images. Relies on a system property #IMAGE_SERVER_BASE_URL_PROPERTY to obtain a base url for an image host.
        Returns:
        valid url string or null if it can't resolve a location
        Throws:
        NullPointerException - on null arguments or null imageUri
      • getImageLocation

        default String getImageLocation​(@NonNull Long id,
                                        @Nullable String fileExtension,
                                        String... conversions)
        Resolves an web location for images. Relies on a system property #IMAGE_SERVER_BASE_URL_PROPERTY to obtain a base url for an image host.
        Returns:
        valid url string or null if it can't resolve a location
        Throws:
        NullPointerException - on null arguments or null imageUri id.
      • appendSecurityTokens

        default void appendSecurityTokens​(StringBuilder builder)