Class DefaultLocalMediaFileCacheService.MediaCacheUnit
java.lang.Object
de.hybris.platform.media.storage.impl.DefaultLocalMediaFileCacheService.MediaCacheUnit
- Enclosing class:
- DefaultLocalMediaFileCacheService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intconvertNumBytesToCacheUnitWeight(long numBytes) getFile()This method returns direct cached File instance.intbooleanvoidprotected voidprotected voidRemoves resource without any checks.toString()void
-
Field Details
-
MIN_UNIT_WEIGHT_IN_KB
public static final int MIN_UNIT_WEIGHT_IN_KB- See Also:
-
-
Constructor Details
-
MediaCacheUnit
-
-
Method Details
-
isCachedFileExists
public boolean isCachedFileExists() -
getFile
This method returns direct cached File instance. It marks cache unit with that information thus any possible eviction to that unit will write special zero-bytes marker file in cache folder and will NOT remove file itself. All marked cache files will be removed on next system restart or may be removed by system administrator manually. Remember that in case of getting cache files as regular File instances may exceed declared cache size due to evictions.- Returns:
- cached file instance
-
getStream
-
markResourceAsEvicted
public void markResourceAsEvicted() -
releaseUsageAndRemoveIfMarked
protected void releaseUsageAndRemoveIfMarked() -
tryRemoveResourceOrWriteEvictedMarker
public void tryRemoveResourceOrWriteEvictedMarker() -
removeResource
protected void removeResource()Removes resource without any checks. Unsafe and not thread safe! -
getWeight
public int getWeight() -
convertNumBytesToCacheUnitWeight
public static int convertNumBytesToCacheUnitWeight(long numBytes) -
toString
-