public class ReplacementServiceDirectImageImpl extends java.lang.Object implements DirectImageReplacementService
ReplacementService
to provide previews for direct
image links.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DIRECT_IMAGE_CONFIG_LABEL
Configuration label shown in the config form.
|
static java.lang.String |
SOURCE_NAME
Source name; also used as property label.
|
static java.lang.String |
URL_PATTERN
The regex used to match the link in the message.
|
Constructor and Description |
---|
ReplacementServiceDirectImageImpl()
Constructor for ReplacementServiceDirectImageImpl.
|
Modifier and Type | Method and Description |
---|---|
int |
getImageSize(java.lang.String sourceString)
Returns the size of the image in bytes.
|
java.lang.String |
getPattern()
Returns the pattern of the source
|
java.lang.String |
getReplacement(java.lang.String sourceString)
Returns the thumbnail URL of the image link provided.
|
java.lang.String |
getSourceName()
Returns the source name
|
boolean |
isDirectImage(java.lang.String sourceString)
Returns true if the content type of the resource
pointed by sourceString is an image.
|
public static final java.lang.String URL_PATTERN
public static final java.lang.String DIRECT_IMAGE_CONFIG_LABEL
public static final java.lang.String SOURCE_NAME
public ReplacementServiceDirectImageImpl()
public java.lang.String getReplacement(java.lang.String sourceString)
getReplacement
in interface ReplacementService
sourceString
- the original image link.public java.lang.String getSourceName()
getSourceName
in interface ReplacementService
public java.lang.String getPattern()
getPattern
in interface ReplacementService
public int getImageSize(java.lang.String sourceString)
DirectImageReplacementService
getImageSize
in interface DirectImageReplacementService
sourceString
- the image link.public boolean isDirectImage(java.lang.String sourceString)
isDirectImage
in interface DirectImageReplacementService
sourceString
- the original image link.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.