Package org.opencms.loader
Class CmsRfsImageCache
java.lang.Object
org.opencms.loader.CmsRfsImageCache
- All Implemented Interfaces:
AutoCloseable,I_CmsImageCache
- Direct Known Subclasses:
CmsFsImageCache
RFS based storage for generated image cache entries.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opencms.loader.I_CmsImageCache
I_CmsImageCache.I_CmsImageCacheEntryVisitor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all image cache entries.booleanReturns if the image cache entry exists.longReturns the image cache entry length.protected PathReturns the image cache repository.Returns the absolute repository path.protected voidinitRepository(Path repository) Initializes the image cache repository.booleanReturns if range delivery is supported.voidVisits all image cache entries.voidWrites an image cache entry.voidwriteRangeTo(String key, long start, long length, OutputStream out) Writes an image cache entry byte range to the output stream.voidwriteTo(String key, OutputStream out) Writes an image cache entry to the output stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencms.loader.I_CmsImageCache
close, existsAuthoritatively, visitEntries
-
Constructor Details
-
CmsRfsImageCache
Creates a new RFS image cache.- Parameters:
repository- the image cache repository path- Throws:
Exception- if the repository can not be initialized
-
-
Method Details
-
clear
Description copied from interface:I_CmsImageCacheClears all image cache entries.- Specified by:
clearin interfaceI_CmsImageCache- Throws:
Exception- if clearing fails- See Also:
-
exists
Description copied from interface:I_CmsImageCacheReturns if the image cache entry exists.- Specified by:
existsin interfaceI_CmsImageCache- Parameters:
key- the image cache key- Returns:
trueif the image cache entry exists- Throws:
Exception- if the store access fails- See Also:
-
getLength
Description copied from interface:I_CmsImageCacheReturns the image cache entry length.- Specified by:
getLengthin interfaceI_CmsImageCache- Parameters:
key- the image cache key- Returns:
- the image cache entry length
- Throws:
Exception- if the store access fails- See Also:
-
getRepositoryPath
Returns the absolute repository path.- Returns:
- the repository path
-
supportsRangeDelivery
Description copied from interface:I_CmsImageCacheReturns if range delivery is supported.- Specified by:
supportsRangeDeliveryin interfaceI_CmsImageCache- Returns:
trueif ranges can be streamed- See Also:
-
visitEntries
Description copied from interface:I_CmsImageCacheVisits all image cache entries.- Specified by:
visitEntriesin interfaceI_CmsImageCache- Parameters:
visitor- the image cache entry visitor- Throws:
Exception- if listing fails- See Also:
-
write
Description copied from interface:I_CmsImageCacheWrites an image cache entry.- Specified by:
writein interfaceI_CmsImageCache- Parameters:
key- the image cache keycontent- the image cache content- Throws:
Exception- if writing fails- See Also:
-
writeRangeTo
Description copied from interface:I_CmsImageCacheWrites an image cache entry byte range to the output stream.- Specified by:
writeRangeToin interfaceI_CmsImageCache- Parameters:
key- the image cache keystart- the first byte to writelength- the number of bytes to writeout- the output stream- Throws:
Exception- if reading fails- See Also:
-
writeTo
Description copied from interface:I_CmsImageCacheWrites an image cache entry to the output stream.- Specified by:
writeToin interfaceI_CmsImageCache- Parameters:
key- the image cache keyout- the output stream- Throws:
Exception- if reading fails- See Also:
-
getRepository
Returns the image cache repository.- Returns:
- the repository
-
initRepository
Initializes the image cache repository.- Parameters:
repository- the image cache repository- Throws:
Exception- if the repository can not be initialized
-