Class DefaultLocalMediaFileCacheService.MediaCacheUnit

java.lang.Object
de.hybris.platform.media.storage.impl.DefaultLocalMediaFileCacheService.MediaCacheUnit
Enclosing class:
DefaultLocalMediaFileCacheService

public static class DefaultLocalMediaFileCacheService.MediaCacheUnit extends Object
  • Field Details

  • Constructor Details

    • MediaCacheUnit

      public MediaCacheUnit(File cachedFile)
  • Method Details

    • isCachedFileExists

      public boolean isCachedFileExists()
    • getFile

      public File 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

      public InputStream 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

      public String toString()
      Overrides:
      toString in class Object