public class ConfluenceUserImageProvider extends HttpExternalUserImageProvider<ConfluenceConfiguration>
Modifier and Type | Field and Description |
---|---|
static String |
CLIENT_PROPERTY_KEY_CONFIG_MODIFIED
Key of a plugin property to store the last modification timestamp of the confluence
configuration since the configuration does not provide this information.
|
USER_PROPERTY_KEY_IMAGE_LAST_MODIFIED, USER_PROPERTY_KEY_IMAGE_VERSION_STRING
Constructor and Description |
---|
ConfluenceUserImageProvider(String symbolicName,
String pathToDefaultImage) |
Modifier and Type | Method and Description |
---|---|
boolean |
canLoad(String imageIdentifier)
Test whether a provider can load the image.
|
protected ConfluenceConfiguration |
getConfiguration() |
protected Long |
getConfigurationChangeTimestamp(ConfluenceConfiguration config)
Get the timestamp of the last configuration change.
|
protected String |
getImageURL(String imageIdentifier,
ConfluenceConfiguration config)
Get the URL under which the image with the given identifier can be downloaded
|
protected org.apache.http.protocol.HttpContext |
getRequestContext(URI imageUrl,
String imageIdentifier,
ConfluenceConfiguration config)
Get request context to be used when downloading the given image.
|
int |
getTimeToLive()
Get the number of seconds until a cached image should expire and thus be reloaded
|
void |
imageChanged(String imageIdentifier)
If imageIdentifier is not null the version string property is removed so that a new one is
created the next time the image with the identifier is accessed.
|
getPropertyKeyGroup, getPropertyManagement, getUserId, getVersionString, imageNotDownloaded, imageSuccessfullyDownloaded, isAuthorized, updateUserProperty
assertNotDisabled, cleanup, disableTemporarily, enable, extractImageFromEntity, getConnectionManagerTimeout, getConnectionTimeout, getDefaultImageVersionString, getDefaultRequestConfig, getDisabledUntilTimestamp, getHttpClient, getLastModifiedHeaderValue, getNotDisablingStatusCodes, getRequestHeaders, getSocketTimeout, hasDefaultImage, isDisabled, isDisablingException, isExternalProvider, isProvideDefaultImageIfDisabled, loadDefaultImage, loadImage, prepareHttpClient, setHttpClient, setProvideDefaultImageIfDisabled, validateContentType, validateStatusCode
getDefaultImageMimeType, getDefaultImageResourceLastModificationTimestamp, getIdentifier
public static final String CLIENT_PROPERTY_KEY_CONFIG_MODIFIED
public boolean canLoad(String imageIdentifier)
ImageProvider
ImageProvider.loadImage(String)
will handle it.canLoad
in class ImageProvider
imageIdentifier
- the identifier of the imageprotected ConfluenceConfiguration getConfiguration()
getConfiguration
in class HttpExternalImageProvider<ConfluenceConfiguration>
protected Long getConfigurationChangeTimestamp(ConfluenceConfiguration config)
HttpExternalUserImageProvider
getConfigurationChangeTimestamp
in class HttpExternalUserImageProvider<ConfluenceConfiguration>
config
- the configuration as returned by HttpExternalImageProvider.getConfiguration()
protected String getImageURL(String imageIdentifier, ConfluenceConfiguration config)
HttpExternalImageProvider
getImageURL
in class HttpExternalImageProvider<ConfluenceConfiguration>
imageIdentifier
- the ID of the image to downloadconfig
- the configuration of the image provider, can be nullprotected org.apache.http.protocol.HttpContext getRequestContext(URI imageUrl, String imageIdentifier, ConfluenceConfiguration config)
HttpExternalImageProvider
getRequestContext
in class HttpExternalImageProvider<ConfluenceConfiguration>
imageUrl
- the URL pointing to the imageimageIdentifier
- the ID of the image to getconfig
- the configuration of the image provider, can be nullpublic int getTimeToLive()
ImageProvider
getTimeToLive
in class ImageProvider
public void imageChanged(String imageIdentifier)
HttpExternalUserImageProvider
imageChanged
in class HttpExternalUserImageProvider<ConfluenceConfiguration>
imageIdentifier
- the identifier of the changed image. Can be null in the case that all images have
changed.Copyright © 2019 Communote team. All rights reserved.