Interface ImageUrlAccordingToHtmlSizeDirective.SrcTranslator

    • Method Detail

      • isCompliantUrl

        boolean isCompliantUrl​(String url)
        Indicates if the given URL is compliant with the current implementation.
        Parameters:
        url - the URL to verify.
        Returns:
        true if compliant, false otherwise.
      • translateUrl

        String translateUrl​(String url,
                            String width,
                            String height)
        Translates the given URL to a new one which is taking into account the given width and the given height.

        isCompliantUrl(String) MUST be verified before calling this method.

        Parameters:
        url - an URL as string.
        width - a width which could be an empty string to represent no width.
        height - a height which could be an empty string to represent no height.
        Returns:
        the translated URL as string.