override fun getRecord()

in core/src/main/java/com/epam/coroutinecache/core/DiskCache.kt [68:82]


    override fun <T> getRecord(key: String, entryType: Type): Record<T>? {
        synchronized(this) {
            @Suppress("TooGenericExceptionCaught")
            return try {
                val safetyKey = safetyKey(key)
                val resultedFile = File(cacheDirectory, safetyKey)
                val type = jsonMapper.newParameterizedType(Record::class.java, entryType)
                val diskRecord: Record<T>? = jsonMapper.fromJson(resultedFile, type)
                diskRecord?.sizeOnMb = (resultedFile.length().toFloat() / sizeMb)
                diskRecord
            } catch (exception: Exception) {
                null
            }
        }
    }