Package nl.vpro.domain.media.support
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
appendSecurityTokens(StringBuilder builder)
default Long
getId(@NonNull Image image)
default @Nullable Long
getIdFromImageUri(@Nullable String imageUri)
String
getImageBaseUrl()
Returns the base url for image 'api' calls.default String
getImageLocation(@NonNull Long id, @Nullable String fileExtension, String... conversions)
Resolves an web location for images.default String
getImageLocation(@NonNull String uri, @Nullable String fileExtension, String... conversions)
Resolves a web location for images.default @PolyNull String
getOriginalUrl(@PolyNull Long id)
default @Nullable String
getOriginalUrlFromImageUri(@Nullable String imageUri)
-
-
-
Method Detail
-
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/
-
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)
-
-