Class SimpleDocumentUrlAccordingToHtmlSizeDirectiveTranslator
- java.lang.Object
-
- org.silverpeas.core.contribution.attachment.SimpleDocumentUrlAccordingToHtmlSizeDirectiveTranslator
-
- All Implemented Interfaces:
ImageUrlAccordingToHtmlSizeDirective.SrcTranslator
@Service public class SimpleDocumentUrlAccordingToHtmlSizeDirectiveTranslator extends Object implements ImageUrlAccordingToHtmlSizeDirective.SrcTranslator
- Author:
- silveryocha
-
-
Constructor Summary
Constructors Constructor Description SimpleDocumentUrlAccordingToHtmlSizeDirectiveTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isCompliantUrl(String url)
Indicates if the given URL is compliant with the current implementation.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.
-
-
-
Method Detail
-
isCompliantUrl
public boolean isCompliantUrl(String url)
Description copied from interface:ImageUrlAccordingToHtmlSizeDirective.SrcTranslator
Indicates if the given URL is compliant with the current implementation.- Specified by:
isCompliantUrl
in interfaceImageUrlAccordingToHtmlSizeDirective.SrcTranslator
- Parameters:
url
- the URL to verify.- Returns:
- true if compliant, false otherwise.
-
translateUrl
public String translateUrl(String url, String width, String height)
Description copied from interface:ImageUrlAccordingToHtmlSizeDirective.SrcTranslator
Translates the given URL to a new one which is taking into account the given width and the given height.ImageUrlAccordingToHtmlSizeDirective.SrcTranslator.isCompliantUrl(String)
MUST be verified before calling this method.- Specified by:
translateUrl
in interfaceImageUrlAccordingToHtmlSizeDirective.SrcTranslator
- 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.
-
-