Class FileCache

    • Constructor Detail

      • FileCache

        public FileCache()
    • Method Detail

      • getCachedFileData

        public static <TFileMeta extends IFileMetaEntity<?,​?>> byte[] getCachedFileData​(UserContext uc,
                                                                                              TFileMeta fileEntity)
        Returns the cached file data if it exists within the file cache and is unchanged. Reads the file data from the database and creates a cache entry otherwise.
        Type Parameters:
        TFileMeta - type of the file entity.
        Parameters:
        uc - user context for database transactions
        fileEntity - to get the data for.
        Returns:
        the binary data of the file or null if it wasn't found.
        Since:
        8.2.0
      • getCachedFile

        public static <TFileMeta extends IFileMetaEntity<?,​?>> IFileAdapter getCachedFile​(UserContext uc,
                                                                                                TFileMeta fileMeta)
        Gets a file adapter that accesses the file data via the file cache (if the file is cacheable).
        Type Parameters:
        TFileMeta - type of the file entity.
        Parameters:
        uc - user context for database transactions
        fileMeta - to get the file adapter for.
        Returns:
        the file adapter for the given file.
        Since:
        8.2.0
      • getCachedFileEntityData

        public static <T extends IFileEntity<?,​?>> byte[] getCachedFileEntityData​(UserContext uc,
                                                                                        T fileEntity)
      • getCachedFile

        public static <TFile extends IFileEntity<?,​?>> IFileAdapter getCachedFile​(UserContext uc,
                                                                                        TFile file)
        Gets a file adapter that accesses the file data via the file cache (if the file is cacheable).
        Type Parameters:
        TFile - type of the file entity.
        Parameters:
        uc - user context for database transactions
        file - to get the file adapter for.
        Returns:
        the file adapter for the given file.
        Since:
        8.2.0
      • getUncachedFileEntityData

        public static <T extends IFileEntity<?,​?>> byte[] getUncachedFileEntityData​(UserContext uc,
                                                                                          T fileEntity)
      • readCachedFileEntityData

        public static <T extends IFileEntity<?,​?>> BinaryCacheModel readCachedFileEntityData​(T fileEntity)
      • cacheFileEntityData

        public static <T extends IFileEntity<?,​?>> byte[] cacheFileEntityData​(UserContext uc,
                                                                                    T fileEntity)
      • getCachedResourceData

        public static byte[] getCachedResourceData​(String cacheKey)