public class ImageDiskCache extends Object
Constructor and Description |
---|
ImageDiskCache()
Default constructor
|
ImageDiskCache(String cacheRootDirectory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
File |
getDefaultImage(String typeName,
String imageProviderId,
ImageSize imageSize)
Get the stored default image.
|
File |
getScaledImage(String typeName,
String imageProviderId,
String imageIdentifier,
ImageSize imageSize)
Get the stored scaled image
|
File |
getUnscaledImage(String typeName,
String imageProviderId,
String imageIdentifier)
Get the stored unscaled image
|
void |
removeDefaultImages(String typeName,
String imageProviderId)
Remove the stored default images for the given type
|
void |
removeImages(String typeName,
String providerId,
String imageIdentifier)
Remove the scaled and unscaled images of the given type that were loaded by the given
provider from disk.
|
void |
removeScaledImages(String typeName)
Remove the scaled images (including the default images) of the given type from disk
|
File |
storeDefaultImage(String typeName,
String imageProviderId,
Image image,
ImageSize imageSize)
Store the provided default image on disk
|
File |
storeScaledImage(String typeName,
String imageProviderId,
String imageIdentifier,
Image image,
ImageSize imageSize)
Store the provided scaled image on disk if it does not yet exist
|
File |
storeUnscaledImage(String typeName,
String imageProviderId,
String imageIdentifier,
Image image)
Store the provided image on disk.
|
public ImageDiskCache()
public ImageDiskCache(String cacheRootDirectory)
cacheRootDirectory
- The caches root dir.public File getDefaultImage(String typeName, String imageProviderId, ImageSize imageSize)
typeName
- the name of the image typeimageProviderId
- the ID of the provider which loaded the imageimageSize
- the size of the default imagepublic File getScaledImage(String typeName, String imageProviderId, String imageIdentifier, ImageSize imageSize)
typeName
- the name of the image typeimageProviderId
- the ID of the provider which loaded the unscaled imageimageIdentifier
- The identifier of the unscaled imageimageSize
- the size of the scaled imagepublic File getUnscaledImage(String typeName, String imageProviderId, String imageIdentifier)
typeName
- the name of the image typeimageProviderId
- the ID of the provider which loaded the unscaled imageimageIdentifier
- The identifier of the unscaled imagepublic void removeDefaultImages(String typeName, String imageProviderId)
typeName
- the name of the image typeimageProviderId
- the ID of the image provider which loaded the default imagepublic void removeImages(String typeName, String providerId, String imageIdentifier)
typeName
- the name of the image type.providerId
- the ID of the provider that loaded the imageimageIdentifier
- identifier of the image to remove. Can be null to remove all images of the
providerpublic void removeScaledImages(String typeName)
typeName
- the name of the image typepublic File storeDefaultImage(String typeName, String imageProviderId, Image image, ImageSize imageSize) throws IOException
typeName
- the name of the image typeimageProviderId
- the ID of the provider which loaded the imageimage
- the default image to storeimageSize
- the size of the default imageIOException
- in case storing the image failedpublic File storeScaledImage(String typeName, String imageProviderId, String imageIdentifier, Image image, ImageSize imageSize) throws IOException
typeName
- the name of the image typeimageProviderId
- the ID of the provider which loaded the unscaled imageimageIdentifier
- The identifier of the unscaled imageimage
- the scaled image to storeimageSize
- the size of the scaled imageIOException
- in case storing failedpublic File storeUnscaledImage(String typeName, String imageProviderId, String imageIdentifier, Image image) throws IOException
typeName
- the name of the image typeimageProviderId
- the ID of the provider which loaded the imageimageIdentifier
- The identifier of the imageimage
- the unscaled image to storeIOException
- in case storing failedCopyright © 2019 Communote team. All rights reserved.